|
| 1 | +-- | This module defines types for STf uncurried functions, as well as |
| 2 | +-- | functions for converting back and forth between them. |
| 3 | +-- | |
| 4 | +-- | The general naming scheme for functions and types in this module is as |
| 5 | +-- | follows: |
| 6 | +-- | |
| 7 | +-- | * `STFn{N}` means, an uncurried function which accepts N arguments and |
| 8 | +-- | performs some STs. The first N arguments are the actual function's |
| 9 | +-- | argument. The last type argument is the return type. |
| 10 | +-- | * `runSTFn{N}` takes an `STFn` of N arguments, and converts it into |
| 11 | +-- | the normal PureScript form: a curried function which returns an ST |
| 12 | +-- | action. |
| 13 | +-- | * `mkSTFn{N}` is the inverse of `runSTFn{N}`. It can be useful for |
| 14 | +-- | callbacks. |
| 15 | +-- | |
| 16 | + |
| 17 | +module Control.Monad.ST.Uncurried where |
| 18 | + |
| 19 | +import Control.Monad.ST.Internal (ST, Region) |
| 20 | + |
| 21 | +foreign import data STFn1 :: Type -> Region -> Type -> Type |
| 22 | + |
| 23 | +type role STFn1 representational nominal representational |
| 24 | + |
| 25 | +foreign import data STFn2 :: Type -> Type -> Region -> Type -> Type |
| 26 | + |
| 27 | +type role STFn2 representational representational nominal representational |
| 28 | + |
| 29 | +foreign import data STFn3 :: Type -> Type -> Type -> Region -> Type -> Type |
| 30 | + |
| 31 | +type role STFn3 representational representational representational nominal representational |
| 32 | + |
| 33 | +foreign import data STFn4 :: Type -> Type -> Type -> Type -> Region -> Type -> Type |
| 34 | + |
| 35 | +type role STFn4 representational representational representational representational nominal representational |
| 36 | + |
| 37 | +foreign import data STFn5 :: Type -> Type -> Type -> Type -> Type -> Region -> Type -> Type |
| 38 | + |
| 39 | +type role STFn5 representational representational representational representational representational nominal representational |
| 40 | + |
| 41 | +foreign import data STFn6 :: Type -> Type -> Type -> Type -> Type -> Type -> Region -> Type -> Type |
| 42 | + |
| 43 | +type role STFn6 representational representational representational representational representational representational nominal representational |
| 44 | + |
| 45 | +foreign import data STFn7 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Region -> Type -> Type |
| 46 | + |
| 47 | +type role STFn7 representational representational representational representational representational representational representational nominal representational |
| 48 | + |
| 49 | +foreign import data STFn8 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Region -> Type -> Type |
| 50 | + |
| 51 | +type role STFn8 representational representational representational representational representational representational representational representational nominal representational |
| 52 | + |
| 53 | +foreign import data STFn9 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Region -> Type -> Type |
| 54 | + |
| 55 | +type role STFn9 representational representational representational representational representational representational representational representational representational nominal representational |
| 56 | + |
| 57 | +foreign import data STFn10 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Region -> Type -> Type |
| 58 | + |
| 59 | +type role STFn10 representational representational representational representational representational representational representational representational representational representational nominal representational |
| 60 | + |
| 61 | +foreign import mkSTFn1 :: forall a t r. |
| 62 | + (a -> ST t r) -> STFn1 a t r |
| 63 | +foreign import mkSTFn2 :: forall a b t r. |
| 64 | + (a -> b -> ST t r) -> STFn2 a b t r |
| 65 | +foreign import mkSTFn3 :: forall a b c t r. |
| 66 | + (a -> b -> c -> ST t r) -> STFn3 a b c t r |
| 67 | +foreign import mkSTFn4 :: forall a b c d t r. |
| 68 | + (a -> b -> c -> d -> ST t r) -> STFn4 a b c d t r |
| 69 | +foreign import mkSTFn5 :: forall a b c d e t r. |
| 70 | + (a -> b -> c -> d -> e -> ST t r) -> STFn5 a b c d e t r |
| 71 | +foreign import mkSTFn6 :: forall a b c d e f t r. |
| 72 | + (a -> b -> c -> d -> e -> f -> ST t r) -> STFn6 a b c d e f t r |
| 73 | +foreign import mkSTFn7 :: forall a b c d e f g t r. |
| 74 | + (a -> b -> c -> d -> e -> f -> g -> ST t r) -> STFn7 a b c d e f g t r |
| 75 | +foreign import mkSTFn8 :: forall a b c d e f g h t r. |
| 76 | + (a -> b -> c -> d -> e -> f -> g -> h -> ST t r) -> STFn8 a b c d e f g h t r |
| 77 | +foreign import mkSTFn9 :: forall a b c d e f g h i t r. |
| 78 | + (a -> b -> c -> d -> e -> f -> g -> h -> i -> ST t r) -> STFn9 a b c d e f g h i t r |
| 79 | +foreign import mkSTFn10 :: forall a b c d e f g h i j t r. |
| 80 | + (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> ST t r) -> STFn10 a b c d e f g h i j t r |
| 81 | + |
| 82 | +foreign import runSTFn1 :: forall a t r. |
| 83 | + STFn1 a t r -> a -> ST t r |
| 84 | +foreign import runSTFn2 :: forall a b t r. |
| 85 | + STFn2 a b t r -> a -> b -> ST t r |
| 86 | +foreign import runSTFn3 :: forall a b c t r. |
| 87 | + STFn3 a b c t r -> a -> b -> c -> ST t r |
| 88 | +foreign import runSTFn4 :: forall a b c d t r. |
| 89 | + STFn4 a b c d t r -> a -> b -> c -> d -> ST t r |
| 90 | +foreign import runSTFn5 :: forall a b c d e t r. |
| 91 | + STFn5 a b c d e t r -> a -> b -> c -> d -> e -> ST t r |
| 92 | +foreign import runSTFn6 :: forall a b c d e f t r. |
| 93 | + STFn6 a b c d e f t r -> a -> b -> c -> d -> e -> f -> ST t r |
| 94 | +foreign import runSTFn7 :: forall a b c d e f g t r. |
| 95 | + STFn7 a b c d e f g t r -> a -> b -> c -> d -> e -> f -> g -> ST t r |
| 96 | +foreign import runSTFn8 :: forall a b c d e f g h t r. |
| 97 | + STFn8 a b c d e f g h t r -> a -> b -> c -> d -> e -> f -> g -> h -> ST t r |
| 98 | +foreign import runSTFn9 :: forall a b c d e f g h i t r. |
| 99 | + STFn9 a b c d e f g h i t r -> a -> b -> c -> d -> e -> f -> g -> h -> i -> ST t r |
| 100 | +foreign import runSTFn10 :: forall a b c d e f g h i j t r. |
| 101 | + STFn10 a b c d e f g h i j t r -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> ST t r |
0 commit comments