{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE BlockArguments #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ImportQualifiedPost #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Dovetail.Core.Data.Function.Uncurried where import Data.Foldable (fold) import Data.Text (Text) import Dovetail import Dovetail.Evaluate (builtIn) import GHC.TypeLits (Nat, type (-)) type family Fn (n :: Nat) (ctx :: *) where Fn 1 ctx = Value ctx -> Eval ctx (Value ctx) Fn n ctx = Value ctx -> Fn (n - 1) ctx env :: forall ctx. Env ctx env :: Env ctx env = do let _ModuleName :: ModuleName _ModuleName = Text -> ModuleName ModuleName Text "Data.Function.Uncurried" fn :: forall (n :: Nat) . (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn :: Text -> Env ctx fn Text name = ModuleName -> Text -> (Fn n ctx -> Fn n ctx) -> Env ctx forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx builtIn @ctx @(Fn n ctx -> Fn n ctx) ModuleName _ModuleName Text name Fn n ctx -> Fn n ctx forall a. a -> a id [Env ctx] -> Env ctx forall (t :: * -> *) m. (Foldable t, Monoid m) => t m -> m fold [ Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @1 Text "runFn0" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @2 Text "runFn2" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @3 Text "runFn3" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @4 Text "runFn4" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @5 Text "runFn5" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @6 Text "runFn6" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @7 Text "runFn7" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @8 Text "runFn8" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @9 Text "runFn9" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @10 Text "runFn10" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @1 Text "mkFn0" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @2 Text "mkFn2" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @3 Text "mkFn3" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @4 Text "mkFn4" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @5 Text "mkFn5" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @6 Text "mkFn6" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @7 Text "mkFn7" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @8 Text "mkFn8" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @9 Text "mkFn9" , Text -> Env ctx forall (n :: Nat). (ToValue ctx (Fn n ctx), ToValueRHS ctx (Fn n ctx)) => Text -> Env ctx fn @10 Text "mkFn10" ]