pire-0.2.5

Copyright(c) Andreas Reuleaux 2015 - 2018
LicenseBSD2
MaintainerAndreas Reuleaux <rx@a-rx.info>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Utils

Description

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

Synopsis

Documentation

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

>>> mapScope (\b -> ()) (\a -> [a]) $ abstract1Name "x" $ V "x"
Scope (V (B ()))
>>> mapScope (\b -> ()) (\a -> [a]) $ abstract1 "x" $ V "x"
Scope (V (B ()))
>>> foldMapBound  (\b -> [b])  $ abstract1Name "x" $ V "x"
[Name "x" ()]
>>> foldMapScope  (\b -> [b]) (\f -> [Name f ()])  $ abstract1Name "x" $ V "z"
[Name "z" ()]
>>> foldMapScope  (\b -> []) (\f -> [f])  $ abstract1Name "x" $ V "z" :@ V "x"
["z"]
>>> fv $ abstract1Name "x" $ V "z" :@ V "y" :@ V "x"
["z","y"]
>>> fv $ abstract1 "x" $ V "z" :@ V "y" :@ V "x"
["z","y"]

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

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

class PrintString a where Source #

Minimal complete definition

printString

Methods

printString :: a -> String Source #

_12 :: Lens' (a, b, c) (a, b) Source #

_13 :: Lens' (a, b, c) (a, c) Source #

class GenList a r | r -> a where Source #

Minimal complete definition

gen'

Methods

gen' :: a -> [a] -> r Source #

Instances

GenList a [a] Source # 

Methods

gen' :: a -> [a] -> [a] Source #

GenList a b => GenList a (a -> b) Source # 

Methods

gen' :: a -> [a] -> a -> b Source #

gen :: GenList a r => a -> r Source #