[GHC] #393: functions without implementations

GHC ghc-devs at haskell.org
Thu Sep 15 15:08:47 UTC 2016


#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_there_a_way_to_make_a/d7nid20
 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


More information about the ghc-tickets mailing list