Copyright | (c) Andreas Reuleaux 2015 - 2018 |
---|---|

License | BSD2 |

Maintainer | Andreas Reuleaux <rx@a-rx.info> |

Stability | experimental |

Portability | non-portable |

Safe Haskell | Safe |

Language | Haskell2010 |

some utility functions for Pire, parts copied and adapted from Ermine, parts copied from https://www.schoolofhaskell.com/user/psygnisfive/from-zipper-to-lens

GenList, gen copied from http://blogger.godfat.org/2009/12/varargs-in-haskell.html

# Documentation

fv :: Foldable f => Scope b f a -> [a] Source #

`>>>`

Scope (V (B ()))`mapScope (\b -> ()) (\a -> [a]) $ abstract1Name "x" $ V "x"`

`>>>`

Scope (V (B ()))`mapScope (\b -> ()) (\a -> [a]) $ abstract1 "x" $ V "x"`

`>>>`

[Name "x" ()]`foldMapBound (\b -> [b]) $ abstract1Name "x" $ V "x"`

`>>>`

[Name "z" ()]`foldMapScope (\b -> [b]) (\f -> [Name f ()]) $ abstract1Name "x" $ V "z"`

`>>>`

["z"]`foldMapScope (\b -> []) (\f -> [f]) $ abstract1Name "x" $ V "z" :@ V "x"`

`>>>`

["z","y"]`fv $ abstract1Name "x" $ V "z" :@ V "y" :@ V "x"`

`>>>`

["z","y"]`fv $ abstract1 "x" $ V "z" :@ V "y" :@ V "x"`

fv' :: Foldable f => f a -> [a] Source #

`>>>`

["a","b"]`fv' $ V "a" :@ V "b"`

`>>>`

["a","b"]`fv' $ lam "x" $ V "a" :@ V "b" :@ V "x"`

class PrintString a where Source #

printString :: a -> String Source #