| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
KleenePlugin
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
HListmore 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
MatchIconstraints, when regular expression and type list are fully determined.So you can tell GHC to
justMatchIt(like withjustDoItfrom 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.