pire-0.2.5

Copyright (c) Andreas Reuleaux 2015 - 2018 BSD2 Andreas Reuleaux experimental non-portable Safe Haskell2010

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

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 #

Instances
 Source # Instance detailsDefined in Utils Methods Source # Instance detailsDefined in Utils Methods

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

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

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

GenList, gen: - generate lists from varargs gen

Minimal complete definition

gen'

Methods

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

Instances
 GenList a [a] Source # Instance detailsDefined in Utils Methodsgen' :: a -> [a] -> [a] Source # GenList a b => GenList a (a -> b) Source # Instance detailsDefined in Utils Methodsgen' :: a -> [a] -> a -> b Source #

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

used :: (Foldable t, Eq a) => a -> t a -> Bool Source #

used: cf.