Skip to content

Commit

Permalink
No SAKS
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjaguarpaw committed Jan 28, 2024
1 parent 51e4ea1 commit 53aff09
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions bluefin-internal/src/Bluefin/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ data Effects = Union Effects Effects
-- | Union of effects
type (:&) = Union

type Eff :: Effects -> Type -> Type
newtype Eff es a = Eff {unsafeUnEff :: IO a}
newtype Eff (es :: Effects) a = Eff {unsafeUnEff :: IO a}
deriving stock (Functor)
deriving newtype (Applicative, Monad)

Expand All @@ -46,20 +45,15 @@ insertSecond = weakenEff (b (drop (eq (# #))))
assoc1Eff :: Eff ((a :& b) :& c) r -> Eff (a :& (b :& c)) r
assoc1Eff = weakenEff (assoc1 (# #))

type Exception :: Type -> Effects -> Type
newtype Exception e ex = Exception (forall a. e -> IO a)
newtype Exception e (ex :: Effects) = Exception (forall a. e -> IO a)

type State :: Type -> Effects -> Type
newtype State s (st :: Effects) = State (IORef s)

type Coroutine :: Type -> Type -> Effects -> Type
newtype Coroutine a b s = Coroutine (a -> IO b)
newtype Coroutine a b (s :: Effects) = Coroutine (a -> IO b)

type Stream :: Type -> Effects -> Type
type Stream a s = Coroutine a () s
type Stream a (s :: Effects) = Coroutine a () s

type In :: Effects -> Effects -> ZeroBitType
newtype In a b = In# (# #)
newtype In (a :: Effects) (b :: Effects) = In# (# #)

-- Hmm, cartesian category
--
Expand Down Expand Up @@ -101,8 +95,7 @@ b :: (a `In` b) -> (c :& a) `In` (c :& b)
b = bimap (eq (# #))

-- | Effect subset constraint
type (:>) :: Effects -> Effects -> Constraint
class effs1 :> effs2
class (effs1 :: Effects) :> (effs2 :: Effects)

-- | A set of effects @e@ is a subset of itself
instance {-# INCOHERENT #-} e :> e
Expand Down

0 comments on commit 53aff09

Please sign in to comment.