
#393: functions without implementations -------------------------------------+------------------------------------- Reporter: c_maeder | Owner: Iceland_jack Type: feature request | Status: new Priority: normal | Milestone: ⊥ Component: Compiler (Type | Version: None checker) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): [https://www.reddit.com/r/haskell/comments/52una4/question_from_a_beginner_is... example]:
You could do:
{{{#!hs data LeafNode a = LeafNode { leafMeta :: LeafMetaData, things :: [a] } }}}
And then put the constraint in your functions instead:
{{{#!hs myFun :: MyTypeClass a => LeafNode a -> b myFun = undefined }}}
{{{#!hs myFun :: MyTypeClass a => LeafNode a -> b }}} would be valid syntax. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/393#comment:37 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler