{-# LANGUAGE OverloadedStrings #-}

module Funcons.Core.Values.Composite.SetsBuiltin where

import Funcons.EDSL hiding (set_)
import qualified Funcons.Operations as VAL 

import qualified Data.Set as S

import Test.RandomStrings (randomString', randomASCII)
import System.IO.Unsafe (unsafePerformIO)

library :: FunconLibrary
library = [(Name, EvalFunction)] -> FunconLibrary
libFromList [
    (Name
"set", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
set_ [OpExpr Funcons] -> OpExpr Funcons
forall t. (Ord t, HasValues t) => [OpExpr t] -> OpExpr t
VAL.set_)
  , (Name
"set-empty", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromNullaryValOp [Funcons] -> Funcons
set_empty_ [OpExpr Funcons] -> OpExpr Funcons
forall t. HasValues t => [OpExpr t] -> OpExpr t
VAL.set_empty_)
  , (Name
"sets", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
sets_ [OpExpr Funcons] -> OpExpr Funcons
forall t. HasValues t => [OpExpr t] -> OpExpr t
VAL.sets_)
  , (Name
"is-in-set", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
is_in_set_ [OpExpr Funcons] -> OpExpr Funcons
forall t. (HasValues t, Ord t) => [OpExpr t] -> OpExpr t
VAL.is_in_set_)
  , (Name
"set-elements", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromSeqValOp [Funcons] -> Funcons
set_elements_ [OpExpr Funcons] -> OpExpr Funcons
forall t. HasValues t => [OpExpr t] -> OpExpr t
VAL.set_elements_)
  , (Name
"is-subset", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
is_subset_ [OpExpr Funcons] -> OpExpr Funcons
forall t. (Ord t, HasValues t) => [OpExpr t] -> OpExpr t
VAL.is_subset_)  
  , (Name
"set-insert", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
set_insert_ [OpExpr Funcons] -> OpExpr Funcons
forall t. (Ord t, HasValues t) => [OpExpr t] -> OpExpr t
VAL.set_insert_)
  , (Name
"set-unite", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
set_unite_ [OpExpr Funcons] -> OpExpr Funcons
forall t. (Ord t, HasValues t) => [OpExpr t] -> OpExpr t
VAL.set_unite_)
  , (Name
"set-intersect", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
set_intersect_ [OpExpr Funcons] -> OpExpr Funcons
forall t. (Ord t, HasValues t) => [OpExpr t] -> OpExpr t
VAL.set_intersect_)
  , (Name
"set-difference", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
set_difference_ [OpExpr Funcons] -> OpExpr Funcons
forall t. (Ord t, HasValues t) => [OpExpr t] -> OpExpr t
VAL.set_difference_)
  , (Name
"set-size", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
set_size_ [OpExpr Funcons] -> OpExpr Funcons
forall t. (Ord t, HasValues t) => [OpExpr t] -> OpExpr t
VAL.set_size_)
  , (Name
"some-element", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
some_element_ [OpExpr Funcons] -> OpExpr Funcons
forall t. (Ord t, HasValues t) => [OpExpr t] -> OpExpr t
VAL.some_element_)
  , (Name
"element-not-in", ([Funcons] -> Funcons)
-> ([OpExpr Funcons] -> OpExpr Funcons) -> EvalFunction
fromValOp [Funcons] -> Funcons
element_not_in_ [OpExpr Funcons] -> OpExpr Funcons
forall t. (HasValues t, Ord t) => [OpExpr t] -> OpExpr t
VAL.element_not_in_)
--  , ("is-set-empty", fromValOp is_set_empty_ VAL.is_set_empty_)
{-    ,   ("is-set-empty", ValueOp is_set_empty_op)
    ,   ("set-to-list", ValueOp stepSetToList)
    ,   ("list-to-set", ValueOp stepList_To_Set)-}
  ]

sets_ :: [Funcons] -> Funcons
sets_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"sets"
set_elements_ :: [Funcons] -> Funcons
set_elements_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"set-elements"
set_size_ :: [Funcons] -> Funcons
set_size_= Name -> [Funcons] -> Funcons
applyFuncon Name
"set-size"
set_intersect_ :: [Funcons] -> Funcons
set_intersect_= Name -> [Funcons] -> Funcons
applyFuncon Name
"set-intersect"
set_difference_ :: [Funcons] -> Funcons
set_difference_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"set-difference"
some_element_ :: [Funcons] -> Funcons
some_element_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"some-element"
is_subset_ :: [Funcons] -> Funcons
is_subset_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"is-subset"
set_ :: [Funcons] -> Funcons
set_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"set"
is_in_set_ :: [Funcons] -> Funcons
is_in_set_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"is-in-set"
set_unite_ :: [Funcons] -> Funcons
set_unite_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"set-unite"
set_insert_ :: [Funcons] -> Funcons
set_insert_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"set-insert"
element_not_in_ :: [Funcons] -> Funcons
element_not_in_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"element-not-in"
set_empty_ :: [Funcons] -> Funcons
set_empty_ = Name -> [Funcons] -> Funcons
applyFuncon Name
"set-empty"
--is_set_empty_ = applyFuncon "is-set-empty"
--set_to_list_ = applyFuncon "set-to-list"