Safe Haskell | Safe-Infered |
---|

Closures. Used when closure converting the source program during vectorisation.

- data a :-> b = forall env . PA env => Clo (env -> a -> b) (Int -> PData env -> PData a -> PData b) env
- ($:) :: (a :-> b) -> a -> b
- data family PData a
- ($:^) :: PArray (a :-> b) -> PArray a -> PArray b
- liftedApply :: Int -> PData (a :-> b) -> PData a -> PData b
- closure1 :: (a -> b) -> (Int -> PData a -> PData b) -> a :-> b
- closure2 :: forall a b c. PA a => (a -> b -> c) -> (Int -> PData a -> PData b -> PData c) -> a :-> (b :-> c)
- closure3 :: forall a b c d. (PA a, PA b) => (a -> b -> c -> d) -> (Int -> PData a -> PData b -> PData c -> PData d) -> a :-> (b :-> (c :-> d))
- closure4 :: forall a b c d e. (PA a, PA b, PA c) => (a -> b -> c -> d -> e) -> (Int -> PData a -> PData b -> PData c -> PData d -> PData e) -> a :-> (b :-> (c :-> (d :-> e)))
- closure5 :: forall a b c d e f. (PA a, PA b, PA c, PA d) => (a -> b -> c -> d -> e -> f) -> (Int -> PData a -> PData b -> PData c -> PData d -> PData e -> PData f) -> a :-> (b :-> (c :-> (d :-> (e :-> f))))
- closure1' :: forall a b. (a -> b) -> (PArray a -> PArray b) -> a :-> b
- closure2' :: forall a b c. PA a => (a -> b -> c) -> (PArray a -> PArray b -> PArray c) -> a :-> (b :-> c)
- closure3' :: forall a b c d. (PA a, PA b) => (a -> b -> c -> d) -> (PArray a -> PArray b -> PArray c -> PArray d) -> a :-> (b :-> (c :-> d))
- closure4' :: forall a b c d e. (PA a, PA b, PA c) => (a -> b -> c -> d -> e) -> (PArray a -> PArray b -> PArray c -> PArray d -> PArray e) -> a :-> (b :-> (c :-> (d :-> e)))
- closure5' :: forall a b c d e f. (PA a, PA b, PA c, PA d) => (a -> b -> c -> d -> e -> f) -> (PArray a -> PArray b -> PArray c -> PArray d -> PArray e -> PArray f) -> a :-> (b :-> (c :-> (d :-> (e :-> f))))

# Closures.

Define the fixity of the closure type constructor.

The type of closures. This bundles up:

# Array Closures.

liftedApply :: Int -> PData (a :-> b) -> PData a -> PData bSource

Lifted closure application, taking an explicit lifting context.

# Closure Construction.

closure1 :: (a -> b) -> (Int -> PData a -> PData b) -> a :-> bSource

Construct an arity-1 closure, from unlifted and lifted versions of a primitive function.

closure2 :: forall a b c. PA a => (a -> b -> c) -> (Int -> PData a -> PData b -> PData c) -> a :-> (b :-> c)Source

Construct an arity-2 closure, from lifted and unlifted versions of a primitive function.

closure3 :: forall a b c d. (PA a, PA b) => (a -> b -> c -> d) -> (Int -> PData a -> PData b -> PData c -> PData d) -> a :-> (b :-> (c :-> d))Source

Construct an arity-3 closure from lifted and unlifted versions of a primitive function.

closure4 :: forall a b c d e. (PA a, PA b, PA c) => (a -> b -> c -> d -> e) -> (Int -> PData a -> PData b -> PData c -> PData d -> PData e) -> a :-> (b :-> (c :-> (d :-> e)))Source

Construct an arity-4 closure from lifted and unlifted versions of a primitive function.

closure5 :: forall a b c d e f. (PA a, PA b, PA c, PA d) => (a -> b -> c -> d -> e -> f) -> (Int -> PData a -> PData b -> PData c -> PData d -> PData e -> PData f) -> a :-> (b :-> (c :-> (d :-> (e :-> f))))Source

Construct an arity-5 closure from lifted and unlifted versions of a primitive function.

closure1' :: forall a b. (a -> b) -> (PArray a -> PArray b) -> a :-> bSource

Construct an arity-1 closure.

closure2' :: forall a b c. PA a => (a -> b -> c) -> (PArray a -> PArray b -> PArray c) -> a :-> (b :-> c)Source

Construct an arity-2 closure.

closure3' :: forall a b c d. (PA a, PA b) => (a -> b -> c -> d) -> (PArray a -> PArray b -> PArray c -> PArray d) -> a :-> (b :-> (c :-> d))Source

Construct an arity-3 closure.