Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
The KleenePlugin does two things:
It's a source plugin, transforming
[[ a, b, c, d, e ]]
into
(a ::: b ::: c ::: d ::: e ::: Nil)
this helps writing
HList
more concisely.Also
([ a, b, c ])
is converted tomkREList [[ a, b, c ]]
and(( f, a, b, c ))
tof ([ a, b, c ])
. This let us write very lispy programs.Also it solves
MatchI
constraints, when regular expression and type list are fully determined.So you can tell GHC to
justMatchIt
(like withjustDoIt
from ghc-justdoit), instead of writing the evidence proofs by hand.
To use plugin add following lines to the top of the source file:
{-# OPTIONS_GHC -fplugin=KleenePlugin #-} {-# OPTIONS_GHC -dcore-lint #-}
Enabling -dcore-lint
is very good idea. KleenePlugin is very experimental.