Safe Haskell | None |
---|

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))))
- closure6 :: forall a b c d e f g. (PA a, PA b, PA c, PA d, PA e) => (a -> b -> c -> d -> e -> f -> g) -> (Int -> PData a -> PData b -> PData c -> PData d -> PData e -> PData f -> PData g) -> a :-> (b :-> (c :-> (d :-> (e :-> (f :-> g)))))
- closure7 :: forall a b c d e f g h. (PA a, PA b, PA c, PA d, PA e, PA f) => (a -> b -> c -> d -> e -> f -> g -> h) -> (Int -> PData a -> PData b -> PData c -> PData d -> PData e -> PData f -> PData g -> PData h) -> a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> h))))))
- closure8 :: forall a b c d e f g h i. (PA a, PA b, PA c, PA d, PA e, PA f, PA g) => (a -> b -> c -> d -> e -> f -> g -> h -> i) -> (Int -> PData a -> PData b -> PData c -> PData d -> PData e -> PData f -> PData g -> PData h -> PData i) -> a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> i)))))))
- 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))))
- closure6' :: forall a b c d e f g. (PA a, PA b, PA c, PA d, PA e, PA f) => (a -> b -> c -> d -> e -> f -> g) -> (PArray a -> PArray b -> PArray c -> PArray d -> PArray e -> PArray f -> PArray g) -> a :-> (b :-> (c :-> (d :-> (e :-> (f :-> g)))))
- closure7' :: forall a b c d e f g h. (PA a, PA b, PA c, PA d, PA e, PA f, PA g) => (a -> b -> c -> d -> e -> f -> g -> h) -> (PArray a -> PArray b -> PArray c -> PArray d -> PArray e -> PArray f -> PArray g -> PArray h) -> a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> h))))))
- closure8' :: forall a b c d e f g h i. (PA a, PA b, PA c, PA d, PA e, PA f, PA g, PA h) => (a -> b -> c -> d -> e -> f -> g -> h -> i) -> (PArray a -> PArray b -> PArray c -> PArray d -> PArray e -> PArray f -> PArray g -> PArray h -> PArray i) -> a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> i)))))))

# 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.

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

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

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

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

closure8 :: forall a b c d e f g h i. (PA a, PA b, PA c, PA d, PA e, PA f, PA g) => (a -> b -> c -> d -> e -> f -> g -> h -> i) -> (Int -> PData a -> PData b -> PData c -> PData d -> PData e -> PData f -> PData g -> PData h -> PData i) -> a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> i)))))))Source

Construct an arity-6 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.

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)))Source

Construct an arity-4 closure.

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))))Source

Construct an arity-5 closure.

closure6' :: forall a b c d e f g. (PA a, PA b, PA c, PA d, PA e, PA f) => (a -> b -> c -> d -> e -> f -> g) -> (PArray a -> PArray b -> PArray c -> PArray d -> PArray e -> PArray f -> PArray g) -> a :-> (b :-> (c :-> (d :-> (e :-> (f :-> g)))))Source

Construct an arity-6 closure.

closure7' :: forall a b c d e f g h. (PA a, PA b, PA c, PA d, PA e, PA f, PA g) => (a -> b -> c -> d -> e -> f -> g -> h) -> (PArray a -> PArray b -> PArray c -> PArray d -> PArray e -> PArray f -> PArray g -> PArray h) -> a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> h))))))Source

Construct an arity-7 closure.

closure8' :: forall a b c d e f g h i. (PA a, PA b, PA c, PA d, PA e, PA f, PA g, PA h) => (a -> b -> c -> d -> e -> f -> g -> h -> i) -> (PArray a -> PArray b -> PArray c -> PArray d -> PArray e -> PArray f -> PArray g -> PArray h -> PArray i) -> a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> i)))))))Source

Construct an arity-8 closure.