[GHC] #12045: Visible kind application
GHC
ghc-devs at haskell.org
Mon Sep 12 20:20:18 UTC 2016
#12045: Visible kind application
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: Iceland_jack
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.1
Resolution: | Keywords:
| TypeApplications TypeInType
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): ​Phab:D2216
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Iceland_jack):
{{{#!hs
type Cat k = k -> k -> Type
data FreeCat :: Cat k -> Cat k where
Nil :: FreeCat f a a
Cons :: f a b -> FreeCat f b c -> FreeCat f a c
liftCat :: f a b -> FreeCat f a b
liftCat x = Cons x Nil
}}}
Free category generated by graph of natural numbers
{{{#!hs
data Node = Unit | N
data NatGraph :: Cat Node where
One :: NatGraph Unit N
Succ :: NatGraph N N
}}}
{{{#!hs
one :: (FreeCat @Node NatGraph) Unit N
one = liftCat One
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12045#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list