{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}

{-# OPTIONS_GHC -Wno-orphans #-}

module Nix.Standard where

import           Control.Applicative
import           Control.Comonad                ( Comonad )
import           Control.Comonad.Env            ( ComonadEnv )
import           Control.Monad.Catch     hiding ( catchJust )
import           Control.Monad.Fail             ( MonadFail )
import           Control.Monad.Free
import           Control.Monad.Reader
import           Control.Monad.Ref
import           Control.Monad.State
import           Data.HashMap.Lazy              ( HashMap )
import           Data.Typeable
import           GHC.Generics
import           Nix.Cited
import           Nix.Cited.Basic
import           Nix.Context
import           Nix.Effects
import           Nix.Effects.Basic
import           Nix.Expr.Types.Annotated
import           Nix.Fresh
import           Nix.Fresh.Basic
import           Nix.Options
import           Nix.Render
import           Nix.Scope
import           Nix.Thunk
import           Nix.Thunk.Basic
import           Nix.Utils.Fix1
import           Nix.Value
import           Nix.Value.Monad
import           Nix.Var

-- All of the following type classes defer to the underlying 'm'.

deriving instance MonadPutStr (t (Fix1 t)) => MonadPutStr (Fix1 t)
deriving instance MonadHttp (t (Fix1 t)) => MonadHttp (Fix1 t)
deriving instance MonadEnv (t (Fix1 t)) => MonadEnv (Fix1 t)
deriving instance MonadPaths (t (Fix1 t)) => MonadPaths (Fix1 t)
deriving instance MonadInstantiate (t (Fix1 t)) => MonadInstantiate (Fix1 t)
deriving instance MonadExec (t (Fix1 t)) => MonadExec (Fix1 t)
deriving instance MonadIntrospect (t (Fix1 t)) => MonadIntrospect (Fix1 t)

deriving instance MonadPutStr (t (Fix1T t m) m) => MonadPutStr (Fix1T t m)
deriving instance MonadHttp (t (Fix1T t m) m) => MonadHttp (Fix1T t m)
deriving instance MonadEnv (t (Fix1T t m) m) => MonadEnv (Fix1T t m)
deriving instance MonadPaths (t (Fix1T t m) m) => MonadPaths (Fix1T t m)
deriving instance MonadInstantiate (t (Fix1T t m) m) => MonadInstantiate (Fix1T t m)
deriving instance MonadExec (t (Fix1T t m) m) => MonadExec (Fix1T t m)
deriving instance MonadIntrospect (t (Fix1T t m) m) => MonadIntrospect (Fix1T t m)

type MonadFix1T t m = (MonadTrans (Fix1T t), Monad (t (Fix1T t m) m))

instance (MonadFix1T t m, MonadRef m) => MonadRef (Fix1T t m) where
  type Ref (Fix1T t m) = Ref m
  newRef :: a -> Fix1T t m (Ref (Fix1T t m) a)
newRef  = m (Ref m a) -> Fix1T t m (Ref m a)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m (Ref m a) -> Fix1T t m (Ref m a))
-> (a -> m (Ref m a)) -> a -> Fix1T t m (Ref m a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> m (Ref m a)
forall (m :: * -> *) a. MonadRef m => a -> m (Ref m a)
newRef
  readRef :: Ref (Fix1T t m) a -> Fix1T t m a
readRef = m a -> Fix1T t m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m a -> Fix1T t m a) -> (Ref m a -> m a) -> Ref m a -> Fix1T t m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ref m a -> m a
forall (m :: * -> *) a. MonadRef m => Ref m a -> m a
readRef
  writeRef :: Ref (Fix1T t m) a -> a -> Fix1T t m ()
writeRef r :: Ref (Fix1T t m) a
r = m () -> Fix1T t m ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m () -> Fix1T t m ()) -> (a -> m ()) -> a -> Fix1T t m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ref m a -> a -> m ()
forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> m ()
writeRef Ref m a
Ref (Fix1T t m) a
r

instance (MonadFix1T t m, MonadAtomicRef m) => MonadAtomicRef (Fix1T t m) where
  atomicModifyRef :: Ref (Fix1T t m) a -> (a -> (a, b)) -> Fix1T t m b
atomicModifyRef r :: Ref (Fix1T t m) a
r = m b -> Fix1T t m b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m b -> Fix1T t m b)
-> ((a -> (a, b)) -> m b) -> (a -> (a, b)) -> Fix1T t m b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ref m a -> (a -> (a, b)) -> m b
forall (m :: * -> *) a b.
MonadAtomicRef m =>
Ref m a -> (a -> (a, b)) -> m b
atomicModifyRef Ref m a
Ref (Fix1T t m) a
r

instance (MonadFix1T t m, MonadFail (Fix1T t m), MonadFile m) => MonadFile (Fix1T t m)

instance (MonadFix1T t m, MonadStore m) => MonadStore (Fix1T t m) where
  addPath' :: String -> Fix1T t m (Either ErrorCall StorePath)
addPath' = m (Either ErrorCall StorePath)
-> Fix1T t m (Either ErrorCall StorePath)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m (Either ErrorCall StorePath)
 -> Fix1T t m (Either ErrorCall StorePath))
-> (String -> m (Either ErrorCall StorePath))
-> String
-> Fix1T t m (Either ErrorCall StorePath)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> m (Either ErrorCall StorePath)
forall (m :: * -> *).
MonadStore m =>
String -> m (Either ErrorCall StorePath)
addPath'
  toFile_' :: String -> String -> Fix1T t m (Either ErrorCall StorePath)
toFile_' n :: String
n = m (Either ErrorCall StorePath)
-> Fix1T t m (Either ErrorCall StorePath)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m (Either ErrorCall StorePath)
 -> Fix1T t m (Either ErrorCall StorePath))
-> (String -> m (Either ErrorCall StorePath))
-> String
-> Fix1T t m (Either ErrorCall StorePath)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String -> m (Either ErrorCall StorePath)
forall (m :: * -> *).
MonadStore m =>
String -> String -> m (Either ErrorCall StorePath)
toFile_' String
n

{------------------------------------------------------------------------}

newtype StdCited m a = StdCited
  { StdCited m a -> Cited (StdThunk m) (StdCited m) m a
_stdCited :: Cited (StdThunk m) (StdCited m) m a }
  deriving
    ( (forall x. StdCited m a -> Rep (StdCited m a) x)
-> (forall x. Rep (StdCited m a) x -> StdCited m a)
-> Generic (StdCited m a)
forall x. Rep (StdCited m a) x -> StdCited m a
forall x. StdCited m a -> Rep (StdCited m a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (m :: * -> *) a x. Rep (StdCited m a) x -> StdCited m a
forall (m :: * -> *) a x. StdCited m a -> Rep (StdCited m a) x
$cto :: forall (m :: * -> *) a x. Rep (StdCited m a) x -> StdCited m a
$cfrom :: forall (m :: * -> *) a x. StdCited m a -> Rep (StdCited m a) x
Generic
    , Typeable
    , a -> StdCited m b -> StdCited m a
(a -> b) -> StdCited m a -> StdCited m b
(forall a b. (a -> b) -> StdCited m a -> StdCited m b)
-> (forall a b. a -> StdCited m b -> StdCited m a)
-> Functor (StdCited m)
forall a b. a -> StdCited m b -> StdCited m a
forall a b. (a -> b) -> StdCited m a -> StdCited m b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (m :: * -> *) a b. a -> StdCited m b -> StdCited m a
forall (m :: * -> *) a b. (a -> b) -> StdCited m a -> StdCited m b
<$ :: a -> StdCited m b -> StdCited m a
$c<$ :: forall (m :: * -> *) a b. a -> StdCited m b -> StdCited m a
fmap :: (a -> b) -> StdCited m a -> StdCited m b
$cfmap :: forall (m :: * -> *) a b. (a -> b) -> StdCited m a -> StdCited m b
Functor
    , Functor (StdCited m)
a -> StdCited m a
Functor (StdCited m) =>
(forall a. a -> StdCited m a)
-> (forall a b.
    StdCited m (a -> b) -> StdCited m a -> StdCited m b)
-> (forall a b c.
    (a -> b -> c) -> StdCited m a -> StdCited m b -> StdCited m c)
-> (forall a b. StdCited m a -> StdCited m b -> StdCited m b)
-> (forall a b. StdCited m a -> StdCited m b -> StdCited m a)
-> Applicative (StdCited m)
StdCited m a -> StdCited m b -> StdCited m b
StdCited m a -> StdCited m b -> StdCited m a
StdCited m (a -> b) -> StdCited m a -> StdCited m b
(a -> b -> c) -> StdCited m a -> StdCited m b -> StdCited m c
forall a. a -> StdCited m a
forall a b. StdCited m a -> StdCited m b -> StdCited m a
forall a b. StdCited m a -> StdCited m b -> StdCited m b
forall a b. StdCited m (a -> b) -> StdCited m a -> StdCited m b
forall a b c.
(a -> b -> c) -> StdCited m a -> StdCited m b -> StdCited m c
forall (m :: * -> *). Functor (StdCited m)
forall (f :: * -> *).
Functor f =>
(forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
forall (m :: * -> *) a. a -> StdCited m a
forall (m :: * -> *) a b.
StdCited m a -> StdCited m b -> StdCited m a
forall (m :: * -> *) a b.
StdCited m a -> StdCited m b -> StdCited m b
forall (m :: * -> *) a b.
StdCited m (a -> b) -> StdCited m a -> StdCited m b
forall (m :: * -> *) a b c.
(a -> b -> c) -> StdCited m a -> StdCited m b -> StdCited m c
<* :: StdCited m a -> StdCited m b -> StdCited m a
$c<* :: forall (m :: * -> *) a b.
StdCited m a -> StdCited m b -> StdCited m a
*> :: StdCited m a -> StdCited m b -> StdCited m b
$c*> :: forall (m :: * -> *) a b.
StdCited m a -> StdCited m b -> StdCited m b
liftA2 :: (a -> b -> c) -> StdCited m a -> StdCited m b -> StdCited m c
$cliftA2 :: forall (m :: * -> *) a b c.
(a -> b -> c) -> StdCited m a -> StdCited m b -> StdCited m c
<*> :: StdCited m (a -> b) -> StdCited m a -> StdCited m b
$c<*> :: forall (m :: * -> *) a b.
StdCited m (a -> b) -> StdCited m a -> StdCited m b
pure :: a -> StdCited m a
$cpure :: forall (m :: * -> *) a. a -> StdCited m a
$cp1Applicative :: forall (m :: * -> *). Functor (StdCited m)
Applicative
    , a -> StdCited m a -> Bool
StdCited m m -> m
StdCited m a -> [a]
StdCited m a -> Bool
StdCited m a -> Int
StdCited m a -> a
StdCited m a -> a
StdCited m a -> a
StdCited m a -> a
(a -> m) -> StdCited m a -> m
(a -> m) -> StdCited m a -> m
(a -> b -> b) -> b -> StdCited m a -> b
(a -> b -> b) -> b -> StdCited m a -> b
(b -> a -> b) -> b -> StdCited m a -> b
(b -> a -> b) -> b -> StdCited m a -> b
(a -> a -> a) -> StdCited m a -> a
(a -> a -> a) -> StdCited m a -> a
(forall m. Monoid m => StdCited m m -> m)
-> (forall m a. Monoid m => (a -> m) -> StdCited m a -> m)
-> (forall m a. Monoid m => (a -> m) -> StdCited m a -> m)
-> (forall a b. (a -> b -> b) -> b -> StdCited m a -> b)
-> (forall a b. (a -> b -> b) -> b -> StdCited m a -> b)
-> (forall b a. (b -> a -> b) -> b -> StdCited m a -> b)
-> (forall b a. (b -> a -> b) -> b -> StdCited m a -> b)
-> (forall a. (a -> a -> a) -> StdCited m a -> a)
-> (forall a. (a -> a -> a) -> StdCited m a -> a)
-> (forall a. StdCited m a -> [a])
-> (forall a. StdCited m a -> Bool)
-> (forall a. StdCited m a -> Int)
-> (forall a. Eq a => a -> StdCited m a -> Bool)
-> (forall a. Ord a => StdCited m a -> a)
-> (forall a. Ord a => StdCited m a -> a)
-> (forall a. Num a => StdCited m a -> a)
-> (forall a. Num a => StdCited m a -> a)
-> Foldable (StdCited m)
forall a. Eq a => a -> StdCited m a -> Bool
forall a. Num a => StdCited m a -> a
forall a. Ord a => StdCited m a -> a
forall m. Monoid m => StdCited m m -> m
forall a. StdCited m a -> Bool
forall a. StdCited m a -> Int
forall a. StdCited m a -> [a]
forall a. (a -> a -> a) -> StdCited m a -> a
forall m a. Monoid m => (a -> m) -> StdCited m a -> m
forall b a. (b -> a -> b) -> b -> StdCited m a -> b
forall a b. (a -> b -> b) -> b -> StdCited m a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
forall (m :: * -> *) a. Eq a => a -> StdCited m a -> Bool
forall (m :: * -> *) a. Num a => StdCited m a -> a
forall (m :: * -> *) a. Ord a => StdCited m a -> a
forall (m :: * -> *) m. Monoid m => StdCited m m -> m
forall (m :: * -> *) a. StdCited m a -> Bool
forall (m :: * -> *) a. StdCited m a -> Int
forall (m :: * -> *) a. StdCited m a -> [a]
forall (m :: * -> *) a. (a -> a -> a) -> StdCited m a -> a
forall (m :: * -> *) m a. Monoid m => (a -> m) -> StdCited m a -> m
forall (m :: * -> *) b a. (b -> a -> b) -> b -> StdCited m a -> b
forall (m :: * -> *) a b. (a -> b -> b) -> b -> StdCited m a -> b
product :: StdCited m a -> a
$cproduct :: forall (m :: * -> *) a. Num a => StdCited m a -> a
sum :: StdCited m a -> a
$csum :: forall (m :: * -> *) a. Num a => StdCited m a -> a
minimum :: StdCited m a -> a
$cminimum :: forall (m :: * -> *) a. Ord a => StdCited m a -> a
maximum :: StdCited m a -> a
$cmaximum :: forall (m :: * -> *) a. Ord a => StdCited m a -> a
elem :: a -> StdCited m a -> Bool
$celem :: forall (m :: * -> *) a. Eq a => a -> StdCited m a -> Bool
length :: StdCited m a -> Int
$clength :: forall (m :: * -> *) a. StdCited m a -> Int
null :: StdCited m a -> Bool
$cnull :: forall (m :: * -> *) a. StdCited m a -> Bool
toList :: StdCited m a -> [a]
$ctoList :: forall (m :: * -> *) a. StdCited m a -> [a]
foldl1 :: (a -> a -> a) -> StdCited m a -> a
$cfoldl1 :: forall (m :: * -> *) a. (a -> a -> a) -> StdCited m a -> a
foldr1 :: (a -> a -> a) -> StdCited m a -> a
$cfoldr1 :: forall (m :: * -> *) a. (a -> a -> a) -> StdCited m a -> a
foldl' :: (b -> a -> b) -> b -> StdCited m a -> b
$cfoldl' :: forall (m :: * -> *) b a. (b -> a -> b) -> b -> StdCited m a -> b
foldl :: (b -> a -> b) -> b -> StdCited m a -> b
$cfoldl :: forall (m :: * -> *) b a. (b -> a -> b) -> b -> StdCited m a -> b
foldr' :: (a -> b -> b) -> b -> StdCited m a -> b
$cfoldr' :: forall (m :: * -> *) a b. (a -> b -> b) -> b -> StdCited m a -> b
foldr :: (a -> b -> b) -> b -> StdCited m a -> b
$cfoldr :: forall (m :: * -> *) a b. (a -> b -> b) -> b -> StdCited m a -> b
foldMap' :: (a -> m) -> StdCited m a -> m
$cfoldMap' :: forall (m :: * -> *) m a. Monoid m => (a -> m) -> StdCited m a -> m
foldMap :: (a -> m) -> StdCited m a -> m
$cfoldMap :: forall (m :: * -> *) m a. Monoid m => (a -> m) -> StdCited m a -> m
fold :: StdCited m m -> m
$cfold :: forall (m :: * -> *) m. Monoid m => StdCited m m -> m
Foldable
    , Functor (StdCited m)
Foldable (StdCited m)
(Functor (StdCited m), Foldable (StdCited m)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> StdCited m a -> f (StdCited m b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    StdCited m (f a) -> f (StdCited m a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> StdCited m a -> m (StdCited m b))
-> (forall (m :: * -> *) a.
    Monad m =>
    StdCited m (m a) -> m (StdCited m a))
-> Traversable (StdCited m)
(a -> f b) -> StdCited m a -> f (StdCited m b)
forall (m :: * -> *). Functor (StdCited m)
forall (m :: * -> *). Foldable (StdCited m)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
StdCited m (m a) -> m (StdCited m a)
forall (f :: * -> *) a.
Applicative f =>
StdCited m (f a) -> f (StdCited m a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> StdCited m a -> m (StdCited m b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> StdCited m a -> f (StdCited m b)
forall (m :: * -> *) (m :: * -> *) a.
Monad m =>
StdCited m (m a) -> m (StdCited m a)
forall (m :: * -> *) (f :: * -> *) a.
Applicative f =>
StdCited m (f a) -> f (StdCited m a)
forall (m :: * -> *) (m :: * -> *) a b.
Monad m =>
(a -> m b) -> StdCited m a -> m (StdCited m b)
forall (m :: * -> *) (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> StdCited m a -> f (StdCited m b)
sequence :: StdCited m (m a) -> m (StdCited m a)
$csequence :: forall (m :: * -> *) (m :: * -> *) a.
Monad m =>
StdCited m (m a) -> m (StdCited m a)
mapM :: (a -> m b) -> StdCited m a -> m (StdCited m b)
$cmapM :: forall (m :: * -> *) (m :: * -> *) a b.
Monad m =>
(a -> m b) -> StdCited m a -> m (StdCited m b)
sequenceA :: StdCited m (f a) -> f (StdCited m a)
$csequenceA :: forall (m :: * -> *) (f :: * -> *) a.
Applicative f =>
StdCited m (f a) -> f (StdCited m a)
traverse :: (a -> f b) -> StdCited m a -> f (StdCited m b)
$ctraverse :: forall (m :: * -> *) (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> StdCited m a -> f (StdCited m b)
$cp2Traversable :: forall (m :: * -> *). Foldable (StdCited m)
$cp1Traversable :: forall (m :: * -> *). Functor (StdCited m)
Traversable
    , Functor (StdCited m)
Functor (StdCited m) =>
(forall a. StdCited m a -> a)
-> (forall a. StdCited m a -> StdCited m (StdCited m a))
-> (forall a b.
    (StdCited m a -> b) -> StdCited m a -> StdCited m b)
-> Comonad (StdCited m)
StdCited m a -> a
StdCited m a -> StdCited m (StdCited m a)
(StdCited m a -> b) -> StdCited m a -> StdCited m b
forall a. StdCited m a -> a
forall a. StdCited m a -> StdCited m (StdCited m a)
forall a b. (StdCited m a -> b) -> StdCited m a -> StdCited m b
forall (m :: * -> *). Functor (StdCited m)
forall (w :: * -> *).
Functor w =>
(forall a. w a -> a)
-> (forall a. w a -> w (w a))
-> (forall a b. (w a -> b) -> w a -> w b)
-> Comonad w
forall (m :: * -> *) a. StdCited m a -> a
forall (m :: * -> *) a. StdCited m a -> StdCited m (StdCited m a)
forall (m :: * -> *) a b.
(StdCited m a -> b) -> StdCited m a -> StdCited m b
extend :: (StdCited m a -> b) -> StdCited m a -> StdCited m b
$cextend :: forall (m :: * -> *) a b.
(StdCited m a -> b) -> StdCited m a -> StdCited m b
duplicate :: StdCited m a -> StdCited m (StdCited m a)
$cduplicate :: forall (m :: * -> *) a. StdCited m a -> StdCited m (StdCited m a)
extract :: StdCited m a -> a
$cextract :: forall (m :: * -> *) a. StdCited m a -> a
$cp1Comonad :: forall (m :: * -> *). Functor (StdCited m)
Comonad
    , ComonadEnv [Provenance m (StdValue m)]
    )

newtype StdThunk (m :: * -> *) = StdThunk
  { StdThunk m -> StdCited m (NThunkF m (StdValue m))
_stdThunk :: StdCited m (NThunkF m (StdValue m)) }

type StdValue m = NValue (StdThunk m) (StdCited m) m

instance Show (StdThunk m) where
  show :: StdThunk m -> String
show _ = "<thunk>"

instance HasCitations1 m (StdValue m) (StdCited m) where
  citations1 :: StdCited m a -> [Provenance m (StdValue m)]
citations1 (StdCited c :: Cited (StdThunk m) (StdCited m) m a
c) = Cited (StdThunk m) (StdCited m) m a -> [Provenance m (StdValue m)]
forall (m :: * -> *) v (f :: * -> *) a.
HasCitations1 m v f =>
f a -> [Provenance m v]
citations1 Cited (StdThunk m) (StdCited m) m a
c
  addProvenance1 :: Provenance m (StdValue m) -> StdCited m a -> StdCited m a
addProvenance1 x :: Provenance m (StdValue m)
x (StdCited c :: Cited (StdThunk m) (StdCited m) m a
c) = Cited (StdThunk m) (StdCited m) m a -> StdCited m a
forall (m :: * -> *) a.
Cited (StdThunk m) (StdCited m) m a -> StdCited m a
StdCited (Provenance m (StdValue m)
-> Cited (StdThunk m) (StdCited m) m a
-> Cited (StdThunk m) (StdCited m) m a
forall (m :: * -> *) v (f :: * -> *) a.
HasCitations1 m v f =>
Provenance m v -> f a -> f a
addProvenance1 Provenance m (StdValue m)
x Cited (StdThunk m) (StdCited m) m a
c)

instance HasCitations m (StdValue m) (StdThunk m) where
  citations :: StdThunk m -> [Provenance m (StdValue m)]
citations (StdThunk c :: StdCited m (NThunkF m (StdValue m))
c) = StdCited m (NThunkF m (StdValue m)) -> [Provenance m (StdValue m)]
forall (m :: * -> *) v (f :: * -> *) a.
HasCitations1 m v f =>
f a -> [Provenance m v]
citations1 StdCited m (NThunkF m (StdValue m))
c
  addProvenance :: Provenance m (StdValue m) -> StdThunk m -> StdThunk m
addProvenance x :: Provenance m (StdValue m)
x (StdThunk c :: StdCited m (NThunkF m (StdValue m))
c) = StdCited m (NThunkF m (StdValue m)) -> StdThunk m
forall (m :: * -> *).
StdCited m (NThunkF m (StdValue m)) -> StdThunk m
StdThunk (Provenance m (StdValue m)
-> StdCited m (NThunkF m (StdValue m))
-> StdCited m (NThunkF m (StdValue m))
forall (m :: * -> *) v (f :: * -> *) a.
HasCitations1 m v f =>
Provenance m v -> f a -> f a
addProvenance1 Provenance m (StdValue m)
x StdCited m (NThunkF m (StdValue m))
c)

instance MonadReader (Context m (StdValue m)) m => Scoped (StdValue m) m where
  currentScopes :: m (Scopes m (StdValue m))
currentScopes = m (Scopes m (StdValue m))
forall (m :: * -> *) a e.
(MonadReader e m, Has e (Scopes m a)) =>
m (Scopes m a)
currentScopesReader
  clearScopes :: m r -> m r
clearScopes   = forall e r.
(MonadReader e m, Has e (Scopes m (StdValue m))) =>
m r -> m r
forall (m :: * -> *) a e r.
(MonadReader e m, Has e (Scopes m a)) =>
m r -> m r
clearScopesReader @m @(StdValue m)
  pushScopes :: Scopes m (StdValue m) -> m r -> m r
pushScopes    = Scopes m (StdValue m) -> m r -> m r
forall e (m :: * -> *) a r.
(MonadReader e m, Has e (Scopes m a)) =>
Scopes m a -> m r -> m r
pushScopesReader
  lookupVar :: Text -> m (Maybe (StdValue m))
lookupVar     = Text -> m (Maybe (StdValue m))
forall (m :: * -> *) a e.
(MonadReader e m, Has e (Scopes m a)) =>
Text -> m (Maybe a)
lookupVarReader

instance ( MonadFix m
         , MonadFile m
         , MonadCatch m
         , MonadEnv m
         , MonadPaths m
         , MonadExec m
         , MonadHttp m
         , MonadInstantiate m
         , MonadIntrospect m
         , MonadPlus m
         , MonadPutStr m
         , MonadStore m
         , MonadAtomicRef m
         , Typeable m
         , Scoped (StdValue m) m
         , MonadReader (Context m (StdValue m)) m
         , MonadState (HashMap FilePath NExprLoc) m
         , MonadDataErrorContext (StdThunk m) (StdCited m) m
         , MonadThunk (StdThunk m) m (StdValue m)
         , MonadValue (StdValue m) m
         )
  => MonadEffects (StdThunk m) (StdCited m) m where
  makeAbsolutePath :: String -> m String
makeAbsolutePath = String -> m String
forall e t (f :: * -> *) (m :: * -> *).
MonadNix e t f m =>
String -> m String
defaultMakeAbsolutePath
  findEnvPath :: String -> m String
findEnvPath      = String -> m String
forall e t (f :: * -> *) (m :: * -> *).
MonadNix e t f m =>
String -> m String
defaultFindEnvPath
  findPath :: [NValue (StdThunk m) (StdCited m) m] -> String -> m String
findPath         = [NValue (StdThunk m) (StdCited m) m] -> String -> m String
forall e t (f :: * -> *) (m :: * -> *).
MonadNix e t f m =>
[NValue t f m] -> String -> m String
defaultFindPath
  importPath :: String -> m (NValue (StdThunk m) (StdCited m) m)
importPath       = String -> m (NValue (StdThunk m) (StdCited m) m)
forall e t (f :: * -> *) (m :: * -> *).
(MonadNix e t f m, MonadState (HashMap String NExprLoc) m) =>
String -> m (NValue t f m)
defaultImportPath
  pathToDefaultNix :: String -> m String
pathToDefaultNix = String -> m String
forall e t (f :: * -> *) (m :: * -> *).
MonadNix e t f m =>
String -> m String
defaultPathToDefaultNix
  derivationStrict :: NValue (StdThunk m) (StdCited m) m
-> m (NValue (StdThunk m) (StdCited m) m)
derivationStrict = NValue (StdThunk m) (StdCited m) m
-> m (NValue (StdThunk m) (StdCited m) m)
forall e t (f :: * -> *) (m :: * -> *).
MonadNix e t f m =>
NValue t f m -> m (NValue t f m)
defaultDerivationStrict
  traceEffect :: String -> m ()
traceEffect      = String -> m ()
forall (m :: * -> *). MonadPutStr m => String -> m ()
defaultTraceEffect

instance ( MonadAtomicRef m
         , MonadCatch m
         , Typeable m
         , MonadReader (Context m (StdValue m)) m
         , MonadThunkId m
         )
  => MonadThunk (StdThunk m) m (StdValue m) where
  thunk :: m (StdValue m) -> m (StdThunk m)
thunk   = (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
 -> StdThunk m)
-> m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
-> m (StdThunk m)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (StdCited m (NThunkF m (StdValue m)) -> StdThunk m
forall (m :: * -> *).
StdCited m (NThunkF m (StdValue m)) -> StdThunk m
StdThunk (StdCited m (NThunkF m (StdValue m)) -> StdThunk m)
-> (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
    -> StdCited m (NThunkF m (StdValue m)))
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
-> StdThunk m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
-> StdCited m (NThunkF m (StdValue m))
forall (m :: * -> *) a.
Cited (StdThunk m) (StdCited m) m a -> StdCited m a
StdCited) (m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
 -> m (StdThunk m))
-> (m (StdValue m)
    -> m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))))
-> m (StdValue m)
-> m (StdThunk m)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. m (StdValue m)
-> m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
forall t (m :: * -> *) a. MonadThunk t m a => m a -> m t
thunk
  thunkId :: StdThunk m -> ThunkId m
thunkId = Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
-> ThunkId m
forall t (m :: * -> *) a. MonadThunk t m a => t -> ThunkId m
thunkId (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
 -> ThunkId m)
-> (StdThunk m
    -> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
-> StdThunk m
-> ThunkId m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StdCited m (NThunkF m (StdValue m))
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
forall (m :: * -> *) a.
StdCited m a -> Cited (StdThunk m) (StdCited m) m a
_stdCited (StdCited m (NThunkF m (StdValue m))
 -> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
-> (StdThunk m -> StdCited m (NThunkF m (StdValue m)))
-> StdThunk m
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StdThunk m -> StdCited m (NThunkF m (StdValue m))
forall (m :: * -> *).
StdThunk m -> StdCited m (NThunkF m (StdValue m))
_stdThunk
  queryM :: StdThunk m -> m r -> (StdValue m -> m r) -> m r
queryM x :: StdThunk m
x b :: m r
b f :: StdValue m -> m r
f = Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
-> m r -> (StdValue m -> m r) -> m r
forall t (m :: * -> *) a r.
MonadThunk t m a =>
t -> m r -> (a -> m r) -> m r
queryM (StdCited m (NThunkF m (StdValue m))
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
forall (m :: * -> *) a.
StdCited m a -> Cited (StdThunk m) (StdCited m) m a
_stdCited (StdThunk m -> StdCited m (NThunkF m (StdValue m))
forall (m :: * -> *).
StdThunk m -> StdCited m (NThunkF m (StdValue m))
_stdThunk StdThunk m
x)) m r
b StdValue m -> m r
f
  force :: StdThunk m -> (StdValue m -> m r) -> m r
force    = Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
-> (StdValue m -> m r) -> m r
forall t (m :: * -> *) a r.
MonadThunk t m a =>
t -> (a -> m r) -> m r
force (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
 -> (StdValue m -> m r) -> m r)
-> (StdThunk m
    -> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
-> StdThunk m
-> (StdValue m -> m r)
-> m r
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StdCited m (NThunkF m (StdValue m))
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
forall (m :: * -> *) a.
StdCited m a -> Cited (StdThunk m) (StdCited m) m a
_stdCited (StdCited m (NThunkF m (StdValue m))
 -> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
-> (StdThunk m -> StdCited m (NThunkF m (StdValue m)))
-> StdThunk m
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StdThunk m -> StdCited m (NThunkF m (StdValue m))
forall (m :: * -> *).
StdThunk m -> StdCited m (NThunkF m (StdValue m))
_stdThunk
  forceEff :: StdThunk m -> (StdValue m -> m r) -> m r
forceEff = Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
-> (StdValue m -> m r) -> m r
forall t (m :: * -> *) a r.
MonadThunk t m a =>
t -> (a -> m r) -> m r
forceEff (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
 -> (StdValue m -> m r) -> m r)
-> (StdThunk m
    -> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
-> StdThunk m
-> (StdValue m -> m r)
-> m r
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StdCited m (NThunkF m (StdValue m))
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
forall (m :: * -> *) a.
StdCited m a -> Cited (StdThunk m) (StdCited m) m a
_stdCited (StdCited m (NThunkF m (StdValue m))
 -> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
-> (StdThunk m -> StdCited m (NThunkF m (StdValue m)))
-> StdThunk m
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StdThunk m -> StdCited m (NThunkF m (StdValue m))
forall (m :: * -> *).
StdThunk m -> StdCited m (NThunkF m (StdValue m))
_stdThunk
  further :: StdThunk m -> (m (StdValue m) -> m (StdValue m)) -> m (StdThunk m)
further  = ((Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
 -> StdThunk m)
-> m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
-> m (StdThunk m)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (StdCited m (NThunkF m (StdValue m)) -> StdThunk m
forall (m :: * -> *).
StdCited m (NThunkF m (StdValue m)) -> StdThunk m
StdThunk (StdCited m (NThunkF m (StdValue m)) -> StdThunk m)
-> (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
    -> StdCited m (NThunkF m (StdValue m)))
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
-> StdThunk m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
-> StdCited m (NThunkF m (StdValue m))
forall (m :: * -> *) a.
Cited (StdThunk m) (StdCited m) m a -> StdCited m a
StdCited) (m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
 -> m (StdThunk m))
-> ((m (StdValue m) -> m (StdValue m))
    -> m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))))
-> (m (StdValue m) -> m (StdValue m))
-> m (StdThunk m)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) (((m (StdValue m) -> m (StdValue m))
  -> m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))))
 -> (m (StdValue m) -> m (StdValue m)) -> m (StdThunk m))
-> (StdThunk m
    -> (m (StdValue m) -> m (StdValue m))
    -> m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))))
-> StdThunk m
-> (m (StdValue m) -> m (StdValue m))
-> m (StdThunk m)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
-> (m (StdValue m) -> m (StdValue m))
-> m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
forall t (m :: * -> *) a.
MonadThunk t m a =>
t -> (m a -> m a) -> m t
further (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
 -> (m (StdValue m) -> m (StdValue m))
 -> m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))))
-> (StdThunk m
    -> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
-> StdThunk m
-> (m (StdValue m) -> m (StdValue m))
-> m (Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StdCited m (NThunkF m (StdValue m))
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
forall (m :: * -> *) a.
StdCited m a -> Cited (StdThunk m) (StdCited m) m a
_stdCited (StdCited m (NThunkF m (StdValue m))
 -> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m)))
-> (StdThunk m -> StdCited m (NThunkF m (StdValue m)))
-> StdThunk m
-> Cited (StdThunk m) (StdCited m) m (NThunkF m (StdValue m))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StdThunk m -> StdCited m (NThunkF m (StdValue m))
forall (m :: * -> *).
StdThunk m -> StdCited m (NThunkF m (StdValue m))
_stdThunk

instance ( MonadAtomicRef m
         , MonadCatch m
         , Typeable m
         , MonadReader (Context m (StdValue m)) m
         , MonadThunkId m
         )
  => MonadValue (StdValue m) m where
  defer :: m (StdValue m) -> m (StdValue m)
defer = (StdThunk m -> StdValue m) -> m (StdThunk m) -> m (StdValue m)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap StdThunk m -> StdValue m
forall (f :: * -> *) a. a -> Free f a
Pure (m (StdThunk m) -> m (StdValue m))
-> (m (StdValue m) -> m (StdThunk m))
-> m (StdValue m)
-> m (StdValue m)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. m (StdValue m) -> m (StdThunk m)
forall t (m :: * -> *) a. MonadThunk t m a => m a -> m t
thunk

  demand :: StdValue m -> (StdValue m -> m r) -> m r
demand (Pure v :: StdThunk m
v) f :: StdValue m -> m r
f = StdThunk m -> (StdValue m -> m r) -> m r
forall t (m :: * -> *) a r.
MonadThunk t m a =>
t -> (a -> m r) -> m r
force StdThunk m
v ((StdValue m -> (StdValue m -> m r) -> m r)
-> (StdValue m -> m r) -> StdValue m -> m r
forall a b c. (a -> b -> c) -> b -> a -> c
flip StdValue m -> (StdValue m -> m r) -> m r
forall v (m :: * -> *) r. MonadValue v m => v -> (v -> m r) -> m r
demand StdValue m -> m r
f)
  demand (Free v :: NValue' (StdThunk m) (StdCited m) m (StdValue m)
v) f :: StdValue m -> m r
f = StdValue m -> m r
f (NValue' (StdThunk m) (StdCited m) m (StdValue m) -> StdValue m
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free NValue' (StdThunk m) (StdCited m) m (StdValue m)
v)

  inform :: StdValue m -> (m (StdValue m) -> m (StdValue m)) -> m (StdValue m)
inform (Pure t :: StdThunk m
t) f :: m (StdValue m) -> m (StdValue m)
f = StdThunk m -> StdValue m
forall (f :: * -> *) a. a -> Free f a
Pure (StdThunk m -> StdValue m) -> m (StdThunk m) -> m (StdValue m)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> StdThunk m -> (m (StdValue m) -> m (StdValue m)) -> m (StdThunk m)
forall t (m :: * -> *) a.
MonadThunk t m a =>
t -> (m a -> m a) -> m t
further StdThunk m
t m (StdValue m) -> m (StdValue m)
f
  inform (Free v :: NValue' (StdThunk m) (StdCited m) m (StdValue m)
v) f :: m (StdValue m) -> m (StdValue m)
f = NValue' (StdThunk m) (StdCited m) m (StdValue m) -> StdValue m
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (NValue' (StdThunk m) (StdCited m) m (StdValue m) -> StdValue m)
-> m (NValue' (StdThunk m) (StdCited m) m (StdValue m))
-> m (StdValue m)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (forall x. m x -> m x)
-> (StdValue m -> m (StdValue m))
-> NValue' (StdThunk m) (StdCited m) m (StdValue m)
-> m (NValue' (StdThunk m) (StdCited m) m (StdValue m))
forall (f :: * -> *) (m :: * -> *) (n :: * -> *) a b t.
(Traversable f, Monad m, Monad n) =>
(forall x. n x -> m x)
-> (a -> n b) -> NValue' t f m a -> n (NValue' t f m b)
bindNValue' forall a. a -> a
forall x. m x -> m x
id ((StdValue m
 -> (m (StdValue m) -> m (StdValue m)) -> m (StdValue m))
-> (m (StdValue m) -> m (StdValue m))
-> StdValue m
-> m (StdValue m)
forall a b c. (a -> b -> c) -> b -> a -> c
flip StdValue m -> (m (StdValue m) -> m (StdValue m)) -> m (StdValue m)
forall v (m :: * -> *). MonadValue v m => v -> (m v -> m v) -> m v
inform m (StdValue m) -> m (StdValue m)
f) NValue' (StdThunk m) (StdCited m) m (StdValue m)
v

{------------------------------------------------------------------------}

-- jww (2019-03-22): NYI
-- whileForcingThunk
--   :: forall t f m s e r . (Exception s, Convertible e t f m) => s -> m r -> m r
-- whileForcingThunk frame =
--   withFrame Debug (ForcingThunk @t @f @m) . withFrame Debug frame

newtype StandardTF r m a
  = StandardTF (ReaderT (Context r (StdValue r))
                        (StateT (HashMap FilePath NExprLoc) m) a)
  deriving
    ( a -> StandardTF r m b -> StandardTF r m a
(a -> b) -> StandardTF r m a -> StandardTF r m b
(forall a b. (a -> b) -> StandardTF r m a -> StandardTF r m b)
-> (forall a b. a -> StandardTF r m b -> StandardTF r m a)
-> Functor (StandardTF r m)
forall a b. a -> StandardTF r m b -> StandardTF r m a
forall a b. (a -> b) -> StandardTF r m a -> StandardTF r m b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (r :: * -> *) (m :: * -> *) a b.
Functor m =>
a -> StandardTF r m b -> StandardTF r m a
forall (r :: * -> *) (m :: * -> *) a b.
Functor m =>
(a -> b) -> StandardTF r m a -> StandardTF r m b
<$ :: a -> StandardTF r m b -> StandardTF r m a
$c<$ :: forall (r :: * -> *) (m :: * -> *) a b.
Functor m =>
a -> StandardTF r m b -> StandardTF r m a
fmap :: (a -> b) -> StandardTF r m a -> StandardTF r m b
$cfmap :: forall (r :: * -> *) (m :: * -> *) a b.
Functor m =>
(a -> b) -> StandardTF r m a -> StandardTF r m b
Functor
    , Functor (StandardTF r m)
a -> StandardTF r m a
Functor (StandardTF r m) =>
(forall a. a -> StandardTF r m a)
-> (forall a b.
    StandardTF r m (a -> b) -> StandardTF r m a -> StandardTF r m b)
-> (forall a b c.
    (a -> b -> c)
    -> StandardTF r m a -> StandardTF r m b -> StandardTF r m c)
-> (forall a b.
    StandardTF r m a -> StandardTF r m b -> StandardTF r m b)
-> (forall a b.
    StandardTF r m a -> StandardTF r m b -> StandardTF r m a)
-> Applicative (StandardTF r m)
StandardTF r m a -> StandardTF r m b -> StandardTF r m b
StandardTF r m a -> StandardTF r m b -> StandardTF r m a
StandardTF r m (a -> b) -> StandardTF r m a -> StandardTF r m b
(a -> b -> c)
-> StandardTF r m a -> StandardTF r m b -> StandardTF r m c
forall a. a -> StandardTF r m a
forall a b.
StandardTF r m a -> StandardTF r m b -> StandardTF r m a
forall a b.
StandardTF r m a -> StandardTF r m b -> StandardTF r m b
forall a b.
StandardTF r m (a -> b) -> StandardTF r m a -> StandardTF r m b
forall a b c.
(a -> b -> c)
-> StandardTF r m a -> StandardTF r m b -> StandardTF r m c
forall (f :: * -> *).
Functor f =>
(forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
forall (r :: * -> *) (m :: * -> *).
Monad m =>
Functor (StandardTF r m)
forall (r :: * -> *) (m :: * -> *) a.
Monad m =>
a -> StandardTF r m a
forall (r :: * -> *) (m :: * -> *) a b.
Monad m =>
StandardTF r m a -> StandardTF r m b -> StandardTF r m a
forall (r :: * -> *) (m :: * -> *) a b.
Monad m =>
StandardTF r m a -> StandardTF r m b -> StandardTF r m b
forall (r :: * -> *) (m :: * -> *) a b.
Monad m =>
StandardTF r m (a -> b) -> StandardTF r m a -> StandardTF r m b
forall (r :: * -> *) (m :: * -> *) a b c.
Monad m =>
(a -> b -> c)
-> StandardTF r m a -> StandardTF r m b -> StandardTF r m c
<* :: StandardTF r m a -> StandardTF r m b -> StandardTF r m a
$c<* :: forall (r :: * -> *) (m :: * -> *) a b.
Monad m =>
StandardTF r m a -> StandardTF r m b -> StandardTF r m a
*> :: StandardTF r m a -> StandardTF r m b -> StandardTF r m b
$c*> :: forall (r :: * -> *) (m :: * -> *) a b.
Monad m =>
StandardTF r m a -> StandardTF r m b -> StandardTF r m b
liftA2 :: (a -> b -> c)
-> StandardTF r m a -> StandardTF r m b -> StandardTF r m c
$cliftA2 :: forall (r :: * -> *) (m :: * -> *) a b c.
Monad m =>
(a -> b -> c)
-> StandardTF r m a -> StandardTF r m b -> StandardTF r m c
<*> :: StandardTF r m (a -> b) -> StandardTF r m a -> StandardTF r m b
$c<*> :: forall (r :: * -> *) (m :: * -> *) a b.
Monad m =>
StandardTF r m (a -> b) -> StandardTF r m a -> StandardTF r m b
pure :: a -> StandardTF r m a
$cpure :: forall (r :: * -> *) (m :: * -> *) a.
Monad m =>
a -> StandardTF r m a
$cp1Applicative :: forall (r :: * -> *) (m :: * -> *).
Monad m =>
Functor (StandardTF r m)
Applicative
    , Applicative (StandardTF r m)
StandardTF r m a
Applicative (StandardTF r m) =>
(forall a. StandardTF r m a)
-> (forall a.
    StandardTF r m a -> StandardTF r m a -> StandardTF r m a)
-> (forall a. StandardTF r m a -> StandardTF r m [a])
-> (forall a. StandardTF r m a -> StandardTF r m [a])
-> Alternative (StandardTF r m)
StandardTF r m a -> StandardTF r m a -> StandardTF r m a
StandardTF r m a -> StandardTF r m [a]
StandardTF r m a -> StandardTF r m [a]
forall a. StandardTF r m a
forall a. StandardTF r m a -> StandardTF r m [a]
forall a. StandardTF r m a -> StandardTF r m a -> StandardTF r m a
forall (f :: * -> *).
Applicative f =>
(forall a. f a)
-> (forall a. f a -> f a -> f a)
-> (forall a. f a -> f [a])
-> (forall a. f a -> f [a])
-> Alternative f
forall (r :: * -> *) (m :: * -> *).
MonadPlus m =>
Applicative (StandardTF r m)
forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a
forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a -> StandardTF r m [a]
forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a -> StandardTF r m a -> StandardTF r m a
many :: StandardTF r m a -> StandardTF r m [a]
$cmany :: forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a -> StandardTF r m [a]
some :: StandardTF r m a -> StandardTF r m [a]
$csome :: forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a -> StandardTF r m [a]
<|> :: StandardTF r m a -> StandardTF r m a -> StandardTF r m a
$c<|> :: forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a -> StandardTF r m a -> StandardTF r m a
empty :: StandardTF r m a
$cempty :: forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a
$cp1Alternative :: forall (r :: * -> *) (m :: * -> *).
MonadPlus m =>
Applicative (StandardTF r m)
Alternative
    , Applicative (StandardTF r m)
a -> StandardTF r m a
Applicative (StandardTF r m) =>
(forall a b.
 StandardTF r m a -> (a -> StandardTF r m b) -> StandardTF r m b)
-> (forall a b.
    StandardTF r m a -> StandardTF r m b -> StandardTF r m b)
-> (forall a. a -> StandardTF r m a)
-> Monad (StandardTF r m)
StandardTF r m a -> (a -> StandardTF r m b) -> StandardTF r m b
StandardTF r m a -> StandardTF r m b -> StandardTF r m b
forall a. a -> StandardTF r m a
forall a b.
StandardTF r m a -> StandardTF r m b -> StandardTF r m b
forall a b.
StandardTF r m a -> (a -> StandardTF r m b) -> StandardTF r m b
forall (m :: * -> *).
Applicative m =>
(forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
forall (r :: * -> *) (m :: * -> *).
Monad m =>
Applicative (StandardTF r m)
forall (r :: * -> *) (m :: * -> *) a.
Monad m =>
a -> StandardTF r m a
forall (r :: * -> *) (m :: * -> *) a b.
Monad m =>
StandardTF r m a -> StandardTF r m b -> StandardTF r m b
forall (r :: * -> *) (m :: * -> *) a b.
Monad m =>
StandardTF r m a -> (a -> StandardTF r m b) -> StandardTF r m b
return :: a -> StandardTF r m a
$creturn :: forall (r :: * -> *) (m :: * -> *) a.
Monad m =>
a -> StandardTF r m a
>> :: StandardTF r m a -> StandardTF r m b -> StandardTF r m b
$c>> :: forall (r :: * -> *) (m :: * -> *) a b.
Monad m =>
StandardTF r m a -> StandardTF r m b -> StandardTF r m b
>>= :: StandardTF r m a -> (a -> StandardTF r m b) -> StandardTF r m b
$c>>= :: forall (r :: * -> *) (m :: * -> *) a b.
Monad m =>
StandardTF r m a -> (a -> StandardTF r m b) -> StandardTF r m b
$cp1Monad :: forall (r :: * -> *) (m :: * -> *).
Monad m =>
Applicative (StandardTF r m)
Monad
    , Monad (StandardTF r m)
Monad (StandardTF r m) =>
(forall a. String -> StandardTF r m a)
-> MonadFail (StandardTF r m)
String -> StandardTF r m a
forall a. String -> StandardTF r m a
forall (m :: * -> *).
Monad m =>
(forall a. String -> m a) -> MonadFail m
forall (r :: * -> *) (m :: * -> *).
MonadFail m =>
Monad (StandardTF r m)
forall (r :: * -> *) (m :: * -> *) a.
MonadFail m =>
String -> StandardTF r m a
fail :: String -> StandardTF r m a
$cfail :: forall (r :: * -> *) (m :: * -> *) a.
MonadFail m =>
String -> StandardTF r m a
$cp1MonadFail :: forall (r :: * -> *) (m :: * -> *).
MonadFail m =>
Monad (StandardTF r m)
MonadFail
    , Monad (StandardTF r m)
Alternative (StandardTF r m)
StandardTF r m a
(Alternative (StandardTF r m), Monad (StandardTF r m)) =>
(forall a. StandardTF r m a)
-> (forall a.
    StandardTF r m a -> StandardTF r m a -> StandardTF r m a)
-> MonadPlus (StandardTF r m)
StandardTF r m a -> StandardTF r m a -> StandardTF r m a
forall a. StandardTF r m a
forall a. StandardTF r m a -> StandardTF r m a -> StandardTF r m a
forall (m :: * -> *).
(Alternative m, Monad m) =>
(forall a. m a) -> (forall a. m a -> m a -> m a) -> MonadPlus m
forall (r :: * -> *) (m :: * -> *).
MonadPlus m =>
Monad (StandardTF r m)
forall (r :: * -> *) (m :: * -> *).
MonadPlus m =>
Alternative (StandardTF r m)
forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a
forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a -> StandardTF r m a -> StandardTF r m a
mplus :: StandardTF r m a -> StandardTF r m a -> StandardTF r m a
$cmplus :: forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a -> StandardTF r m a -> StandardTF r m a
mzero :: StandardTF r m a
$cmzero :: forall (r :: * -> *) (m :: * -> *) a.
MonadPlus m =>
StandardTF r m a
$cp2MonadPlus :: forall (r :: * -> *) (m :: * -> *).
MonadPlus m =>
Monad (StandardTF r m)
$cp1MonadPlus :: forall (r :: * -> *) (m :: * -> *).
MonadPlus m =>
Alternative (StandardTF r m)
MonadPlus
    , Monad (StandardTF r m)
Monad (StandardTF r m) =>
(forall a. (a -> StandardTF r m a) -> StandardTF r m a)
-> MonadFix (StandardTF r m)
(a -> StandardTF r m a) -> StandardTF r m a
forall a. (a -> StandardTF r m a) -> StandardTF r m a
forall (m :: * -> *).
Monad m =>
(forall a. (a -> m a) -> m a) -> MonadFix m
forall (r :: * -> *) (m :: * -> *).
MonadFix m =>
Monad (StandardTF r m)
forall (r :: * -> *) (m :: * -> *) a.
MonadFix m =>
(a -> StandardTF r m a) -> StandardTF r m a
mfix :: (a -> StandardTF r m a) -> StandardTF r m a
$cmfix :: forall (r :: * -> *) (m :: * -> *) a.
MonadFix m =>
(a -> StandardTF r m a) -> StandardTF r m a
$cp1MonadFix :: forall (r :: * -> *) (m :: * -> *).
MonadFix m =>
Monad (StandardTF r m)
MonadFix
    , Monad (StandardTF r m)
Monad (StandardTF r m) =>
(forall a. IO a -> StandardTF r m a) -> MonadIO (StandardTF r m)
IO a -> StandardTF r m a
forall a. IO a -> StandardTF r m a
forall (m :: * -> *).
Monad m =>
(forall a. IO a -> m a) -> MonadIO m
forall (r :: * -> *) (m :: * -> *).
MonadIO m =>
Monad (StandardTF r m)
forall (r :: * -> *) (m :: * -> *) a.
MonadIO m =>
IO a -> StandardTF r m a
liftIO :: IO a -> StandardTF r m a
$cliftIO :: forall (r :: * -> *) (m :: * -> *) a.
MonadIO m =>
IO a -> StandardTF r m a
$cp1MonadIO :: forall (r :: * -> *) (m :: * -> *).
MonadIO m =>
Monad (StandardTF r m)
MonadIO
    , MonadThrow (StandardTF r m)
MonadThrow (StandardTF r m) =>
(forall e a.
 Exception e =>
 StandardTF r m a -> (e -> StandardTF r m a) -> StandardTF r m a)
-> MonadCatch (StandardTF r m)
StandardTF r m a -> (e -> StandardTF r m a) -> StandardTF r m a
forall e a.
Exception e =>
StandardTF r m a -> (e -> StandardTF r m a) -> StandardTF r m a
forall (m :: * -> *).
MonadThrow m =>
(forall e a. Exception e => m a -> (e -> m a) -> m a)
-> MonadCatch m
forall (r :: * -> *) (m :: * -> *).
MonadCatch m =>
MonadThrow (StandardTF r m)
forall (r :: * -> *) (m :: * -> *) e a.
(MonadCatch m, Exception e) =>
StandardTF r m a -> (e -> StandardTF r m a) -> StandardTF r m a
catch :: StandardTF r m a -> (e -> StandardTF r m a) -> StandardTF r m a
$ccatch :: forall (r :: * -> *) (m :: * -> *) e a.
(MonadCatch m, Exception e) =>
StandardTF r m a -> (e -> StandardTF r m a) -> StandardTF r m a
$cp1MonadCatch :: forall (r :: * -> *) (m :: * -> *).
MonadCatch m =>
MonadThrow (StandardTF r m)
MonadCatch
    , Monad (StandardTF r m)
e -> StandardTF r m a
Monad (StandardTF r m) =>
(forall e a. Exception e => e -> StandardTF r m a)
-> MonadThrow (StandardTF r m)
forall e a. Exception e => e -> StandardTF r m a
forall (m :: * -> *).
Monad m =>
(forall e a. Exception e => e -> m a) -> MonadThrow m
forall (r :: * -> *) (m :: * -> *).
MonadThrow m =>
Monad (StandardTF r m)
forall (r :: * -> *) (m :: * -> *) e a.
(MonadThrow m, Exception e) =>
e -> StandardTF r m a
throwM :: e -> StandardTF r m a
$cthrowM :: forall (r :: * -> *) (m :: * -> *) e a.
(MonadThrow m, Exception e) =>
e -> StandardTF r m a
$cp1MonadThrow :: forall (r :: * -> *) (m :: * -> *).
MonadThrow m =>
Monad (StandardTF r m)
MonadThrow
    , MonadCatch (StandardTF r m)
MonadCatch (StandardTF r m) =>
(forall b.
 ((forall a. StandardTF r m a -> StandardTF r m a)
  -> StandardTF r m b)
 -> StandardTF r m b)
-> (forall b.
    ((forall a. StandardTF r m a -> StandardTF r m a)
     -> StandardTF r m b)
    -> StandardTF r m b)
-> (forall a b c.
    StandardTF r m a
    -> (a -> ExitCase b -> StandardTF r m c)
    -> (a -> StandardTF r m b)
    -> StandardTF r m (b, c))
-> MonadMask (StandardTF r m)
StandardTF r m a
-> (a -> ExitCase b -> StandardTF r m c)
-> (a -> StandardTF r m b)
-> StandardTF r m (b, c)
((forall a. StandardTF r m a -> StandardTF r m a)
 -> StandardTF r m b)
-> StandardTF r m b
((forall a. StandardTF r m a -> StandardTF r m a)
 -> StandardTF r m b)
-> StandardTF r m b
forall b.
((forall a. StandardTF r m a -> StandardTF r m a)
 -> StandardTF r m b)
-> StandardTF r m b
forall a b c.
StandardTF r m a
-> (a -> ExitCase b -> StandardTF r m c)
-> (a -> StandardTF r m b)
-> StandardTF r m (b, c)
forall (m :: * -> *).
MonadCatch m =>
(forall b. ((forall a. m a -> m a) -> m b) -> m b)
-> (forall b. ((forall a. m a -> m a) -> m b) -> m b)
-> (forall a b c.
    m a -> (a -> ExitCase b -> m c) -> (a -> m b) -> m (b, c))
-> MonadMask m
forall (r :: * -> *) (m :: * -> *).
MonadMask m =>
MonadCatch (StandardTF r m)
forall (r :: * -> *) (m :: * -> *) b.
MonadMask m =>
((forall a. StandardTF r m a -> StandardTF r m a)
 -> StandardTF r m b)
-> StandardTF r m b
forall (r :: * -> *) (m :: * -> *) a b c.
MonadMask m =>
StandardTF r m a
-> (a -> ExitCase b -> StandardTF r m c)
-> (a -> StandardTF r m b)
-> StandardTF r m (b, c)
generalBracket :: StandardTF r m a
-> (a -> ExitCase b -> StandardTF r m c)
-> (a -> StandardTF r m b)
-> StandardTF r m (b, c)
$cgeneralBracket :: forall (r :: * -> *) (m :: * -> *) a b c.
MonadMask m =>
StandardTF r m a
-> (a -> ExitCase b -> StandardTF r m c)
-> (a -> StandardTF r m b)
-> StandardTF r m (b, c)
uninterruptibleMask :: ((forall a. StandardTF r m a -> StandardTF r m a)
 -> StandardTF r m b)
-> StandardTF r m b
$cuninterruptibleMask :: forall (r :: * -> *) (m :: * -> *) b.
MonadMask m =>
((forall a. StandardTF r m a -> StandardTF r m a)
 -> StandardTF r m b)
-> StandardTF r m b
mask :: ((forall a. StandardTF r m a -> StandardTF r m a)
 -> StandardTF r m b)
-> StandardTF r m b
$cmask :: forall (r :: * -> *) (m :: * -> *) b.
MonadMask m =>
((forall a. StandardTF r m a -> StandardTF r m a)
 -> StandardTF r m b)
-> StandardTF r m b
$cp1MonadMask :: forall (r :: * -> *) (m :: * -> *).
MonadMask m =>
MonadCatch (StandardTF r m)
MonadMask
    , MonadReader (Context r (StdValue r))
    , MonadState (HashMap FilePath NExprLoc)
    )

instance MonadTrans (StandardTF r) where
  lift :: m a -> StandardTF r m a
lift = ReaderT
  (Context r (StdValue r)) (StateT (HashMap String NExprLoc) m) a
-> StandardTF r m a
forall (r :: * -> *) (m :: * -> *) a.
ReaderT
  (Context r (StdValue r)) (StateT (HashMap String NExprLoc) m) a
-> StandardTF r m a
StandardTF (ReaderT
   (Context r (StdValue r)) (StateT (HashMap String NExprLoc) m) a
 -> StandardTF r m a)
-> (m a
    -> ReaderT
         (Context r (StdValue r)) (StateT (HashMap String NExprLoc) m) a)
-> m a
-> StandardTF r m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateT (HashMap String NExprLoc) m a
-> ReaderT
     (Context r (StdValue r)) (StateT (HashMap String NExprLoc) m) a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (StateT (HashMap String NExprLoc) m a
 -> ReaderT
      (Context r (StdValue r)) (StateT (HashMap String NExprLoc) m) a)
-> (m a -> StateT (HashMap String NExprLoc) m a)
-> m a
-> ReaderT
     (Context r (StdValue r)) (StateT (HashMap String NExprLoc) m) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. m a -> StateT (HashMap String NExprLoc) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift

instance (MonadPutStr r, MonadPutStr m) => MonadPutStr (StandardTF r m)
instance (MonadHttp r, MonadHttp m) => MonadHttp (StandardTF r m)
instance (MonadEnv r, MonadEnv m) => MonadEnv (StandardTF r m)
instance (MonadPaths r, MonadPaths m) => MonadPaths (StandardTF r m)
instance (MonadInstantiate r, MonadInstantiate m) => MonadInstantiate (StandardTF r m)
instance (MonadExec r, MonadExec m) => MonadExec (StandardTF r m)
instance (MonadIntrospect r, MonadIntrospect m) => MonadIntrospect (StandardTF r m)

{------------------------------------------------------------------------}

type StandardT m = Fix1T StandardTF m

instance MonadTrans (Fix1T StandardTF) where
  lift :: m a -> Fix1T StandardTF m a
lift = StandardTF (Fix1T StandardTF m) m a -> Fix1T StandardTF m a
forall k (t :: (k -> *) -> (* -> *) -> k -> *) (m :: * -> *)
       (a :: k).
t (Fix1T t m) m a -> Fix1T t m a
Fix1T (StandardTF (Fix1T StandardTF m) m a -> Fix1T StandardTF m a)
-> (m a -> StandardTF (Fix1T StandardTF m) m a)
-> m a
-> Fix1T StandardTF m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. m a -> StandardTF (Fix1T StandardTF m) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift

instance MonadThunkId m => MonadThunkId (Fix1T StandardTF m) where
  type ThunkId (Fix1T StandardTF m) = ThunkId m

mkStandardT
  :: ReaderT
       (Context (StandardT m) (StdValue (StandardT m)))
       (StateT (HashMap FilePath NExprLoc) m)
       a
  -> StandardT m a
mkStandardT :: ReaderT
  (Context (StandardT m) (StdValue (StandardT m)))
  (StateT (HashMap String NExprLoc) m)
  a
-> StandardT m a
mkStandardT = StandardTF (StandardT m) m a -> StandardT m a
forall k (t :: (k -> *) -> (* -> *) -> k -> *) (m :: * -> *)
       (a :: k).
t (Fix1T t m) m a -> Fix1T t m a
Fix1T (StandardTF (StandardT m) m a -> StandardT m a)
-> (ReaderT
      (Context (StandardT m) (StdValue (StandardT m)))
      (StateT (HashMap String NExprLoc) m)
      a
    -> StandardTF (StandardT m) m a)
-> ReaderT
     (Context (StandardT m) (StdValue (StandardT m)))
     (StateT (HashMap String NExprLoc) m)
     a
-> StandardT m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ReaderT
  (Context (StandardT m) (StdValue (StandardT m)))
  (StateT (HashMap String NExprLoc) m)
  a
-> StandardTF (StandardT m) m a
forall (r :: * -> *) (m :: * -> *) a.
ReaderT
  (Context r (StdValue r)) (StateT (HashMap String NExprLoc) m) a
-> StandardTF r m a
StandardTF

runStandardT
  :: StandardT m a
  -> ReaderT
       (Context (StandardT m) (StdValue (StandardT m)))
       (StateT (HashMap FilePath NExprLoc) m)
       a
runStandardT :: StandardT m a
-> ReaderT
     (Context (StandardT m) (StdValue (StandardT m)))
     (StateT (HashMap String NExprLoc) m)
     a
runStandardT (Fix1T (StandardTF m :: ReaderT
  (Context (StandardT m) (StdValue (StandardT m)))
  (StateT (HashMap String NExprLoc) m)
  a
m)) = ReaderT
  (Context (StandardT m) (StdValue (StandardT m)))
  (StateT (HashMap String NExprLoc) m)
  a
m

runWithBasicEffects
  :: (MonadIO m, MonadAtomicRef m) => Options -> StandardT (StdIdT m) a -> m a
runWithBasicEffects :: Options -> StandardT (StdIdT m) a -> m a
runWithBasicEffects opts :: Options
opts =
  FreshIdT Int m a -> m a
forall (m :: * -> *) b. MonadRef m => FreshIdT Int m b -> m b
go (FreshIdT Int m a -> m a)
-> (StandardT (StdIdT m) a -> FreshIdT Int m a)
-> StandardT (StdIdT m) a
-> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateT (HashMap String NExprLoc) (StdIdT m) a
-> HashMap String NExprLoc -> FreshIdT Int m a
forall (m :: * -> *) s a. Monad m => StateT s m a -> s -> m a
`evalStateT` HashMap String NExprLoc
forall a. Monoid a => a
mempty) (StateT (HashMap String NExprLoc) (StdIdT m) a -> FreshIdT Int m a)
-> (StandardT (StdIdT m) a
    -> StateT (HashMap String NExprLoc) (StdIdT m) a)
-> StandardT (StdIdT m) a
-> FreshIdT Int m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ReaderT
  (Context (StandardT (StdIdT m)) (StdValue (StandardT (StdIdT m))))
  (StateT (HashMap String NExprLoc) (StdIdT m))
  a
-> Context (StandardT (StdIdT m)) (StdValue (StandardT (StdIdT m)))
-> StateT (HashMap String NExprLoc) (StdIdT m) a
forall r (m :: * -> *) a. ReaderT r m a -> r -> m a
`runReaderT` Options
-> Context (StandardT (StdIdT m)) (StdValue (StandardT (StdIdT m)))
forall (m :: * -> *) t. Options -> Context m t
newContext Options
opts) (ReaderT
   (Context (StandardT (StdIdT m)) (StdValue (StandardT (StdIdT m))))
   (StateT (HashMap String NExprLoc) (StdIdT m))
   a
 -> StateT (HashMap String NExprLoc) (StdIdT m) a)
-> (StandardT (StdIdT m) a
    -> ReaderT
         (Context (StandardT (StdIdT m)) (StdValue (StandardT (StdIdT m))))
         (StateT (HashMap String NExprLoc) (StdIdT m))
         a)
-> StandardT (StdIdT m) a
-> StateT (HashMap String NExprLoc) (StdIdT m) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StandardT (StdIdT m) a
-> ReaderT
     (Context (StandardT (StdIdT m)) (StdValue (StandardT (StdIdT m))))
     (StateT (HashMap String NExprLoc) (StdIdT m))
     a
forall (m :: * -> *) a.
StandardT m a
-> ReaderT
     (Context (StandardT m) (StdValue (StandardT m)))
     (StateT (HashMap String NExprLoc) m)
     a
runStandardT
 where
  go :: FreshIdT Int m b -> m b
go action :: FreshIdT Int m b
action = do
    Ref m Int
i <- Int -> m (Ref m Int)
forall (m :: * -> *) a. MonadRef m => a -> m (Ref m a)
newVar (1 :: Int)
    Ref m Int -> FreshIdT Int m b -> m b
forall (m :: * -> *) i a.
Functor m =>
Var m i -> FreshIdT i m a -> m a
runFreshIdT Ref m Int
i FreshIdT Int m b
action

runWithBasicEffectsIO :: Options -> StandardT (StdIdT IO) a -> IO a
runWithBasicEffectsIO :: Options -> StandardT (StdIdT IO) a -> IO a
runWithBasicEffectsIO = Options -> StandardT (StdIdT IO) a -> IO a
forall (m :: * -> *) a.
(MonadIO m, MonadAtomicRef m) =>
Options -> StandardT (StdIdT m) a -> m a
runWithBasicEffects