Skip to content

Commit

Permalink
Add roles declarations to allow safe coercions (purescript#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
kl0tl authored Oct 3, 2020
1 parent 45b6b30 commit 584b304
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Effect.purs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import Control.Apply (lift2)
-- | eventually produces a value of the type `Int` when it finishes.
foreign import data Effect :: Type -> Type

type role Effect representational

instance functorEffect :: Functor Effect where
map = liftA1

Expand Down
29 changes: 29 additions & 0 deletions src/Effect/Uncurried.purs
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,45 @@ import Data.Monoid (class Monoid, class Semigroup, mempty, (<>))
import Effect (Effect)

foreign import data EffectFn1 :: Type -> Type -> Type

type role EffectFn1 representational representational

foreign import data EffectFn2 :: Type -> Type -> Type -> Type

type role EffectFn2 representational representational representational

foreign import data EffectFn3 :: Type -> Type -> Type -> Type -> Type

type role EffectFn3 representational representational representational representational

foreign import data EffectFn4 :: Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn4 representational representational representational representational representational

foreign import data EffectFn5 :: Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn5 representational representational representational representational representational representational

foreign import data EffectFn6 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn6 representational representational representational representational representational representational representational

foreign import data EffectFn7 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn7 representational representational representational representational representational representational representational representational

foreign import data EffectFn8 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn8 representational representational representational representational representational representational representational representational representational

foreign import data EffectFn9 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn9 representational representational representational representational representational representational representational representational representational representational

foreign import data EffectFn10 :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type

type role EffectFn10 representational representational representational representational representational representational representational representational representational representational representational

foreign import mkEffectFn1 :: forall a r.
(a -> Effect r) -> EffectFn1 a r
foreign import mkEffectFn2 :: forall a b r.
Expand Down

0 comments on commit 584b304

Please sign in to comment.