-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Write functions in tacit (pointless) style using Applicative and De Bruijn index notation. -- -- Write functions in tacit (pointless) style using Applicative and De -- Bruijn index notation. @package data-function-tacit @version 0.1.0.0 -- | Write functions in tacit (pointless) style using Applicative and De -- Bruijn index notation. -- -- Examples: -- --
\f x y -> f x == f y = lurryA @N3 ((==) <$> (_1 -- <*> _2) <*> (_1 <*> _3))
\f g x -> f x (g x) = lurryA @N3 ((_1 <*> _3) -- <*> (_2 <*> _3))
\a b -> b = lurryA @N2 _2
-- Lurried ((a, (b, (c, ()))) -> d) ~ a -> b -> c -> d ---- | "Curry" a function with a tuple-list argument. -- -- This type class should be treated as closed. The instances provided -- map exactly to the type-level recursion defined by Lurried. -- -- Use lurryA instead of lurry, which helps resolve -- ambiguity. class Lurry f lurry :: Lurry f => f -> Lurried f -- | Next argument. s :: (a, b) -> b -- | First argument. z :: (a, b) -> a -- | First argument. _1 :: (a, b) -> a -- | Second argument. _2 :: (a, (b, c)) -> b -- | Third argument. _3 :: (a, (b, (c, d))) -> c -- | Fourth argument. _4 :: (a, (b, (c, (e, f)))) -> e -- | Fifth argument. _5 :: (a, (b, (c, (e, (f, g))))) -> f -- | Sixth argument. _6 :: (a, (b, (c, (e, (f, (g, h)))))) -> g -- | Seventh argument. _7 :: (a, (b, (c, (e, (f, (g, (h, i))))))) -> h -- | Eighth argument. _8 :: (a, (b, (c, (e, (f, (g, (h, (i, j)))))))) -> i -- | Ninth argument. _9 :: (a, (b, (c, (e, (f, (g, (h, (i, (j, k))))))))) -> j -- | Peano numbers. data Nat [Z] :: Nat [S] :: Nat -> Nat -- | The Peano number 0. type N0 = Z -- | The Peano number 1. type N1 = S N0 -- | The Peano number 2. type N2 = S N1 -- | The Peano number 3. type N3 = S N2 -- | The Peano number 4. type N4 = S N3 -- | The Peano number 5. type N5 = S N4 -- | The Peano number 6. type N6 = S N5 -- | The Peano number 7. type N7 = S N6 -- | The Peano number 8. type N8 = S N7 -- | The Peano number 9. type N9 = S N8 -- | Cap a tuple-list to the given length. -- -- Example: -- --
-- Take N2 (a, (b, (c, d))) ~ (a, (b, ())) ---- | Lurry a function of given arity. This arity must match exactly to the -- highest index used to avoid ambiguity (see the module docs). -- Otherwise, an explicit signature for the function must be given. -- -- Example: -- --
-- lurryA @N2 (_1 <*> _2) = ($) --lurryA :: (Take n p ~ p', p ~ p', Lurry (p -> r)) => (p -> r) -> Lurried (p' -> r) -- | Increments the argument indices of a function. -- -- Example: -- --
-- shift (_1 <*> _2) = _2 <*> _3 --shift :: ((b, c) -> d) -> (a, (b, c)) -> d instance Data.Function.Tacit.Lurry ((a, ()) -> r) instance Data.Function.Tacit.Lurry ((b, cs) -> r) => Data.Function.Tacit.Lurry ((a, (b, cs)) -> r)