module Hydra.Impl.Haskell.Sources.Libraries where

import Hydra.All
import Hydra.Impl.Haskell.Dsl.Prims as Prims
import qualified Hydra.Impl.Haskell.Dsl.Terms as Terms
import qualified Hydra.Impl.Haskell.Dsl.Types as Types

import qualified Hydra.Lib.Flows as Flows
import qualified Hydra.Lib.Lists as Lists
import qualified Hydra.Lib.Literals as Literals
import qualified Hydra.Lib.Maps as Maps
import qualified Hydra.Lib.Math as Math
import qualified Hydra.Lib.Optionals as Optionals
import qualified Hydra.Lib.Sets as Sets
import qualified Hydra.Lib.Strings as Strings


_hydra_lib_flows :: Namespace
_hydra_lib_flows :: Namespace
_hydra_lib_flows = String -> Namespace
Namespace String
"hydra/lib/flows"

_flows_apply :: Name
_flows_apply :: Name
_flows_apply = Namespace -> String -> Name
qname Namespace
_hydra_lib_flows String
"apply"

_flows_bind :: Name
_flows_bind :: Name
_flows_bind = Namespace -> String -> Name
qname Namespace
_hydra_lib_flows String
"bind"

_flows_map :: Name
_flows_map :: Name
_flows_map = Namespace -> String -> Name
qname Namespace
_hydra_lib_flows String
"map"

_flows_pure :: Name
_flows_pure :: Name
_flows_pure = Namespace -> String -> Name
qname Namespace
_hydra_lib_flows String
"pure"

_hydra_lib_io :: Namespace
_hydra_lib_io :: Namespace
_hydra_lib_io = String -> Namespace
Namespace String
"hydra/lib/io"

_io_showTerm :: Name
_io_showTerm :: Name
_io_showTerm = Namespace -> String -> Name
qname Namespace
_hydra_lib_io String
"showTerm"

_io_showType :: Name
_io_showType :: Name
_io_showType = Namespace -> String -> Name
qname Namespace
_hydra_lib_io String
"showType"

_hydra_lib_lists :: Namespace
_hydra_lib_lists :: Namespace
_hydra_lib_lists = String -> Namespace
Namespace String
"hydra/lib/lists"

_lists_apply :: Name
_lists_apply :: Name
_lists_apply = Namespace -> String -> Name
qname Namespace
_hydra_lib_lists String
"apply"

_lists_bind :: Name
_lists_bind :: Name
_lists_bind = Namespace -> String -> Name
qname Namespace
_hydra_lib_lists String
"bind"

_lists_concat :: Name
_lists_concat :: Name
_lists_concat = Namespace -> String -> Name
qname Namespace
_hydra_lib_lists String
"concat"

_lists_head :: Name
_lists_head :: Name
_lists_head = Namespace -> String -> Name
qname Namespace
_hydra_lib_lists String
"head"

_lists_intercalate :: Name
_lists_intercalate :: Name
_lists_intercalate = Namespace -> String -> Name
qname Namespace
_hydra_lib_lists String
"intercalate"

_lists_intersperse :: Name
_lists_intersperse :: Name
_lists_intersperse = Namespace -> String -> Name
qname Namespace
_hydra_lib_lists String
"intersperse"

_lists_last :: Name
_lists_last :: Name
_lists_last = Namespace -> String -> Name
qname Namespace
_hydra_lib_lists String
"last"

_lists_length :: Name
_lists_length :: Name
_lists_length = Namespace -> String -> Name
qname Namespace
_hydra_lib_lists String
"length"

_lists_map :: Name
_lists_map :: Name
_lists_map = Namespace -> String -> Name
qname Namespace
_hydra_lib_lists String
"map"

_lists_pure :: Name
_lists_pure :: Name
_lists_pure = Namespace -> String -> Name
qname Namespace
_hydra_lib_lists String
"pure"

_hydra_lib_literals :: Namespace
_hydra_lib_literals :: Namespace
_hydra_lib_literals = String -> Namespace
Namespace String
"hydra/lib/literals"

_literals_showInt32 :: Name
_literals_showInt32 :: Name
_literals_showInt32 = Namespace -> String -> Name
qname Namespace
_hydra_lib_literals String
"showInt32"

_literals_showString :: Name
_literals_showString :: Name
_literals_showString = Namespace -> String -> Name
qname Namespace
_hydra_lib_literals String
"showString"

_hydra_lib_maps :: Namespace
_hydra_lib_maps :: Namespace
_hydra_lib_maps = String -> Namespace
Namespace String
"hydra/lib/maps"

_maps_map :: Name
_maps_map :: Name
_maps_map = Namespace -> String -> Name
qname Namespace
_hydra_lib_maps String
"map"

_maps_size :: Name
_maps_size :: Name
_maps_size = Namespace -> String -> Name
qname Namespace
_hydra_lib_maps String
"size"

_hydra_lib_math :: Namespace
_hydra_lib_math :: Namespace
_hydra_lib_math = String -> Namespace
Namespace String
"hydra/lib/math"

_math_add :: Name
_math_add :: Name
_math_add = Namespace -> String -> Name
qname Namespace
_hydra_lib_math String
"add"

_math_div :: Name
_math_div :: Name
_math_div = Namespace -> String -> Name
qname Namespace
_hydra_lib_math String
"div"

_math_mod :: Name
_math_mod :: Name
_math_mod = Namespace -> String -> Name
qname Namespace
_hydra_lib_math String
"mod"

_math_mul :: Name
_math_mul :: Name
_math_mul = Namespace -> String -> Name
qname Namespace
_hydra_lib_math String
"mul"

_math_neg :: Name
_math_neg :: Name
_math_neg = Namespace -> String -> Name
qname Namespace
_hydra_lib_math String
"neg"

_math_rem :: Name
_math_rem :: Name
_math_rem = Namespace -> String -> Name
qname Namespace
_hydra_lib_math String
"rem"

_math_sub :: Name
_math_sub :: Name
_math_sub = Namespace -> String -> Name
qname Namespace
_hydra_lib_math String
"sub"

_hydra_lib_optionals :: Namespace
_hydra_lib_optionals :: Namespace
_hydra_lib_optionals = String -> Namespace
Namespace String
"hydra/lib/optionals"

_optionals_apply :: Name
_optionals_apply :: Name
_optionals_apply = Namespace -> String -> Name
qname Namespace
_hydra_lib_optionals String
"apply"

_optionals_bind :: Name
_optionals_bind :: Name
_optionals_bind = Namespace -> String -> Name
qname Namespace
_hydra_lib_optionals String
"bind"

_optionals_map :: Name
_optionals_map :: Name
_optionals_map = Namespace -> String -> Name
qname Namespace
_hydra_lib_optionals String
"map"

_optionals_pure :: Name
_optionals_pure :: Name
_optionals_pure = Namespace -> String -> Name
qname Namespace
_hydra_lib_optionals String
"pure"

_hydra_lib_sets :: Namespace
_hydra_lib_sets :: Namespace
_hydra_lib_sets = String -> Namespace
Namespace String
"hydra/lib/sets"

_sets_insert :: Name
_sets_insert :: Name
_sets_insert = Namespace -> String -> Name
qname Namespace
_hydra_lib_sets String
"add"

_sets_contains :: Name
_sets_contains :: Name
_sets_contains = Namespace -> String -> Name
qname Namespace
_hydra_lib_sets String
"contains"

_sets_fromList :: Name
_sets_fromList :: Name
_sets_fromList = Namespace -> String -> Name
qname Namespace
_hydra_lib_sets String
"fromList"

_sets_isEmpty :: Name
_sets_isEmpty :: Name
_sets_isEmpty = Namespace -> String -> Name
qname Namespace
_hydra_lib_sets String
"isEmpty"

_sets_map :: Name
_sets_map :: Name
_sets_map = Namespace -> String -> Name
qname Namespace
_hydra_lib_sets String
"map"

_sets_remove :: Name
_sets_remove :: Name
_sets_remove = Namespace -> String -> Name
qname Namespace
_hydra_lib_sets String
"remove"

_sets_singleton :: Name
_sets_singleton :: Name
_sets_singleton = Namespace -> String -> Name
qname Namespace
_hydra_lib_sets String
"pure"

_sets_size :: Name
_sets_size :: Name
_sets_size = Namespace -> String -> Name
qname Namespace
_hydra_lib_sets String
"size"

_sets_toList :: Name
_sets_toList :: Name
_sets_toList = Namespace -> String -> Name
qname Namespace
_hydra_lib_sets String
"toList"

_hydra_lib_strings :: Namespace
_hydra_lib_strings :: Namespace
_hydra_lib_strings = String -> Namespace
Namespace String
"hydra/lib/strings"

_strings_cat :: Name
_strings_cat :: Name
_strings_cat = Namespace -> String -> Name
qname Namespace
_hydra_lib_strings String
"cat"

_strings_length :: Name
_strings_length :: Name
_strings_length = Namespace -> String -> Name
qname Namespace
_hydra_lib_strings String
"length"

_strings_splitOn :: Name
_strings_splitOn :: Name
_strings_splitOn = Namespace -> String -> Name
qname Namespace
_hydra_lib_strings String
"splitOn"

_strings_toLower :: Name
_strings_toLower :: Name
_strings_toLower = Namespace -> String -> Name
qname Namespace
_hydra_lib_strings String
"toLower"

_strings_toUpper :: Name
_strings_toUpper :: Name
_strings_toUpper = Namespace -> String -> Name
qname Namespace
_hydra_lib_strings String
"toUpper"

--hydraIoPrimitives = [
--  unaryPrimitive _io_showTerm (variable "a) string
--  ]

hydraLibFlowsPrimitives :: Show m => [PrimitiveFunction m]
hydraLibFlowsPrimitives :: forall m. Show m => [PrimitiveFunction m]
hydraLibFlowsPrimitives = [
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_flows_apply (forall m s a.
TermCoder m s -> TermCoder m a -> TermCoder m (Flow s a)
flow (forall m. String -> TermCoder m (Term m)
variable String
"s") (forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m. String -> TermCoder m (Term m)
variable String
"b"))) (forall m s a.
TermCoder m s -> TermCoder m a -> TermCoder m (Flow s a)
flow (forall m. String -> TermCoder m (Term m)
variable String
"s") (forall m. String -> TermCoder m (Term m)
variable String
"a")) (forall m s a.
TermCoder m s -> TermCoder m a -> TermCoder m (Flow s a)
flow (forall m. String -> TermCoder m (Term m)
variable String
"s") (forall m. String -> TermCoder m (Term m)
variable String
"b")) forall s a b. Flow s (a -> b) -> Flow s a -> Flow s b
Flows.apply,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_flows_bind (forall m s a.
TermCoder m s -> TermCoder m a -> TermCoder m (Flow s a)
flow (forall m. String -> TermCoder m (Term m)
variable String
"s") (forall m. String -> TermCoder m (Term m)
variable String
"a")) (forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m s a.
TermCoder m s -> TermCoder m a -> TermCoder m (Flow s a)
flow (forall m. String -> TermCoder m (Term m)
variable String
"s") (forall m. String -> TermCoder m (Term m)
variable String
"b"))) (forall m s a.
TermCoder m s -> TermCoder m a -> TermCoder m (Flow s a)
flow (forall m. String -> TermCoder m (Term m)
variable String
"s") (forall m. String -> TermCoder m (Term m)
variable String
"b")) forall s a b. Flow s a -> (a -> Flow s b) -> Flow s b
Flows.bind,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_flows_map (forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m. String -> TermCoder m (Term m)
variable String
"b")) (forall m s a.
TermCoder m s -> TermCoder m a -> TermCoder m (Flow s a)
flow (forall m. String -> TermCoder m (Term m)
variable String
"s") (forall m. String -> TermCoder m (Term m)
variable String
"a")) (forall m s a.
TermCoder m s -> TermCoder m a -> TermCoder m (Flow s a)
flow (forall m. String -> TermCoder m (Term m)
variable String
"s") (forall m. String -> TermCoder m (Term m)
variable String
"b")) forall a b s. (a -> b) -> Flow s a -> Flow s b
Flows.map,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_flows_pure (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m s a.
TermCoder m s -> TermCoder m a -> TermCoder m (Flow s a)
flow (forall m. String -> TermCoder m (Term m)
variable String
"s") (forall m. String -> TermCoder m (Term m)
variable String
"a")) forall a s. a -> Flow s a
Flows.pure]

hydraLibListsPrimitives :: Show m => [PrimitiveFunction m]
hydraLibListsPrimitives :: forall m. Show m => [PrimitiveFunction m]
hydraLibListsPrimitives = [
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_lists_apply (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m. String -> TermCoder m (Term m)
variable String
"b")) (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"b") forall a b. [a -> b] -> [a] -> [b]
Lists.apply,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_lists_bind (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"b")) (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"b") forall a b. [a] -> (a -> [b]) -> [b]
Lists.bind,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_lists_concat (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. [[a]] -> [a]
Lists.concat,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_lists_head (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. [a] -> a
Lists.head,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_lists_intercalate (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. [a] -> [[a]] -> [a]
Lists.intercalate,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_lists_intersperse (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. a -> [a] -> [a]
Lists.intersperse,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_lists_last (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. [a] -> a
Lists.last,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_lists_length (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall m. Show m => TermCoder m Int
int32 forall a. [a] -> Int
Lists.length,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_lists_map (forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m. String -> TermCoder m (Term m)
variable String
"b")) (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"b") forall a b. (a -> b) -> [a] -> [b]
Lists.map,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_lists_pure (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. a -> [a]
Lists.pure]

hydraLibLiteralsPrimitives :: Show m => [PrimitiveFunction m]
hydraLibLiteralsPrimitives :: forall m. Show m => [PrimitiveFunction m]
hydraLibLiteralsPrimitives = [
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_literals_showInt32 forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m String
string Int -> String
Literals.showInt32,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_literals_showString forall m. Show m => TermCoder m String
string forall m. Show m => TermCoder m String
string String -> String
Literals.showString]

hydraLibMapsPrimitives :: (Ord m, Show m) => [PrimitiveFunction m]
hydraLibMapsPrimitives :: forall m. (Ord m, Show m) => [PrimitiveFunction m]
hydraLibMapsPrimitives = [
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_optionals_map
    (forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"v1") (forall m. String -> TermCoder m (Term m)
variable String
"v2"))
    (forall k m v.
(Ord k, Ord m, Show m) =>
TermCoder m k -> TermCoder m v -> TermCoder m (Map k v)
Prims.map (forall m. String -> TermCoder m (Term m)
variable String
"k") (forall m. String -> TermCoder m (Term m)
variable String
"v1"))
    (forall k m v.
(Ord k, Ord m, Show m) =>
TermCoder m k -> TermCoder m v -> TermCoder m (Map k v)
Prims.map (forall m. String -> TermCoder m (Term m)
variable String
"k") (forall m. String -> TermCoder m (Term m)
variable String
"v2"))
    forall v1 v2 k. (v1 -> v2) -> Map k v1 -> Map k v2
Maps.map,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_sets_size (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall m. Show m => TermCoder m Int
int32 forall a. Set a -> Int
Sets.size]

hydraLibMathInt32Primitives :: Show m => [PrimitiveFunction m]
hydraLibMathInt32Primitives :: forall m. Show m => [PrimitiveFunction m]
hydraLibMathInt32Primitives = [
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_math_add forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 Int -> Int -> Int
Math.add,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_math_div forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 Int -> Int -> Int
Math.div,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_math_mod forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 Int -> Int -> Int
Math.mod,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_math_mul forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 Int -> Int -> Int
Math.mul,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_math_neg forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 Int -> Int
Math.neg,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_math_rem forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 Int -> Int -> Int
Math.rem,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_math_sub forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 forall m. Show m => TermCoder m Int
int32 Int -> Int -> Int
Math.sub]

hydraLibOptionalsPrimitives :: Show m => [PrimitiveFunction m]
hydraLibOptionalsPrimitives :: forall m. Show m => [PrimitiveFunction m]
hydraLibOptionalsPrimitives = [
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_optionals_apply (forall m a. Show m => TermCoder m a -> TermCoder m (Maybe a)
optional forall a b. (a -> b) -> a -> b
$ forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m. String -> TermCoder m (Term m)
variable String
"b")) (forall m a. Show m => TermCoder m a -> TermCoder m (Maybe a)
optional forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m (Maybe a)
optional forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"b") forall a b. Maybe (a -> b) -> Maybe a -> Maybe b
Optionals.apply,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_optionals_bind (forall m a. Show m => TermCoder m a -> TermCoder m (Maybe a)
optional forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m (Maybe a)
optional forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"b")) (forall m a. Show m => TermCoder m a -> TermCoder m (Maybe a)
optional forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"b") forall a b. Maybe a -> (a -> Maybe b) -> Maybe b
Optionals.bind,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_optionals_map (forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m. String -> TermCoder m (Term m)
variable String
"b")) (forall m a. Show m => TermCoder m a -> TermCoder m (Maybe a)
optional forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m (Maybe a)
optional forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"b") forall a b. (a -> b) -> Maybe a -> Maybe b
Optionals.map,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_optionals_pure (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m (Maybe a)
optional forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. a -> Maybe a
Optionals.pure]

hydraLibSetsPrimitives :: (Ord m, Show m) => [PrimitiveFunction m]
hydraLibSetsPrimitives :: forall m. (Ord m, Show m) => [PrimitiveFunction m]
hydraLibSetsPrimitives = [
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_sets_contains (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall m. Show m => TermCoder m Bool
boolean forall a. Ord a => a -> Set a -> Bool
Sets.contains,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_sets_fromList (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. Ord a => [a] -> Set a
Sets.fromList,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_sets_insert (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. Ord a => a -> Set a -> Set a
Sets.insert,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_sets_isEmpty (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall m. Show m => TermCoder m Bool
boolean forall a. Set a -> Bool
Sets.isEmpty,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_sets_map (forall m a b.
TermCoder m a -> TermCoder m b -> TermCoder m (a -> b)
function (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m. String -> TermCoder m (Term m)
variable String
"b")) (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"b") forall b a. Ord b => (a -> b) -> Set a -> Set b
Sets.map,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_sets_remove (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. Ord a => a -> Set a -> Set a
Sets.remove,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_sets_singleton (forall m. String -> TermCoder m (Term m)
variable String
"a") (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. a -> Set a
Sets.singleton,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_sets_size (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall m. Show m => TermCoder m Int
int32 forall a. Set a -> Int
Sets.size,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_sets_toList (forall a m.
(Ord a, Ord m, Show m) =>
TermCoder m a -> TermCoder m (Set a)
set forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall a b. (a -> b) -> a -> b
$ forall m. String -> TermCoder m (Term m)
variable String
"a") forall a. Ord a => Set a -> [a]
Sets.toList]

hydraLibStringsPrimitives :: Show m => [PrimitiveFunction m]
hydraLibStringsPrimitives :: forall m. Show m => [PrimitiveFunction m]
hydraLibStringsPrimitives = [
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_strings_cat (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall m. Show m => TermCoder m String
string) forall m. Show m => TermCoder m String
string [String] -> String
Strings.cat,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_strings_length forall m. Show m => TermCoder m String
string forall m. Show m => TermCoder m Int
int32 String -> Int
Strings.length,
  forall m a b c.
Name
-> TermCoder m a
-> TermCoder m b
-> TermCoder m c
-> (a -> b -> c)
-> PrimitiveFunction m
binaryPrimitive Name
_strings_splitOn forall m. Show m => TermCoder m String
string forall m. Show m => TermCoder m String
string (forall m a. Show m => TermCoder m a -> TermCoder m [a]
list forall m. Show m => TermCoder m String
string) String -> String -> [String]
Strings.splitOn,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_strings_toLower forall m. Show m => TermCoder m String
string forall m. Show m => TermCoder m String
string String -> String
Strings.toLower,
  forall m a b.
Name
-> TermCoder m a
-> TermCoder m b
-> (a -> b)
-> PrimitiveFunction m
unaryPrimitive Name
_strings_toUpper forall m. Show m => TermCoder m String
string forall m. Show m => TermCoder m String
string String -> String
Strings.toUpper]

standardPrimitives :: (Ord m, Show m) => [PrimitiveFunction m]
standardPrimitives :: forall m. (Ord m, Show m) => [PrimitiveFunction m]
standardPrimitives =
     forall m. Show m => [PrimitiveFunction m]
hydraLibFlowsPrimitives
  forall a. [a] -> [a] -> [a]
++ forall m. Show m => [PrimitiveFunction m]
hydraLibListsPrimitives
  forall a. [a] -> [a] -> [a]
++ forall m. Show m => [PrimitiveFunction m]
hydraLibLiteralsPrimitives
  forall a. [a] -> [a] -> [a]
++ forall m. (Ord m, Show m) => [PrimitiveFunction m]
hydraLibMapsPrimitives
  forall a. [a] -> [a] -> [a]
++ forall m. Show m => [PrimitiveFunction m]
hydraLibMathInt32Primitives
  forall a. [a] -> [a] -> [a]
++ forall m. Show m => [PrimitiveFunction m]
hydraLibOptionalsPrimitives
  forall a. [a] -> [a] -> [a]
++ forall m. (Ord m, Show m) => [PrimitiveFunction m]
hydraLibSetsPrimitives
  forall a. [a] -> [a] -> [a]
++ forall m. Show m => [PrimitiveFunction m]
hydraLibStringsPrimitives