{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ViewPatterns #-}
module Dovetail.Core.Data.String.CodePoints where
import Data.Foldable (fold)
import Data.Text (Text)
import Data.Vector (Vector)
import Dovetail
import Dovetail.Evaluate (builtIn)
type CodePoint = Integer
env :: forall ctx. Env ctx
env :: Env ctx
env = do
let _ModuleName :: ModuleName
_ModuleName = Text -> ModuleName
ModuleName Text
"Data.String.CodePoints"
[Env ctx] -> Env ctx
forall (t :: * -> *) m. (Foldable t, Monoid m) => t m -> m
fold
[
ModuleName
-> Text
-> ((CodePoint -> Eval ctx Text) -> CodePoint -> Eval ctx Text)
-> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @((CodePoint -> Eval ctx Text) -> CodePoint -> Eval ctx Text)
ModuleName
_ModuleName Text
"_singleton"
\CodePoint -> Eval ctx Text
fallback -> CodePoint -> Eval ctx Text
fallback
, ModuleName
-> Text
-> ((Vector CodePoint -> Eval ctx Text)
-> Vector CodePoint -> Eval ctx Text)
-> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @((Vector CodePoint -> Eval ctx Text) -> Vector CodePoint -> Eval ctx Text)
ModuleName
_ModuleName Text
"_fromCodePointArray"
\Vector CodePoint -> Eval ctx Text
fallback -> Vector CodePoint -> Eval ctx Text
fallback
, ModuleName
-> Text
-> ((Text -> Eval ctx (Vector CodePoint))
-> (Text -> Eval ctx CodePoint)
-> Text
-> Eval ctx (Vector CodePoint))
-> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @((Text -> Eval ctx (Vector CodePoint)) -> (Text -> Eval ctx CodePoint) -> Text -> Eval ctx (Vector CodePoint))
ModuleName
_ModuleName Text
"_toCodePointArray"
\Text -> Eval ctx (Vector CodePoint)
fallback Text -> Eval ctx CodePoint
_ -> Text -> Eval ctx (Vector CodePoint)
fallback
, ModuleName
-> Text
-> ((CodePoint -> Text -> Eval ctx (Value ctx))
-> (Value ctx -> Eval ctx (Value ctx))
-> Value ctx
-> (Text -> Eval ctx CodePoint)
-> CodePoint
-> Text
-> Eval ctx (Value ctx))
-> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @((Integer -> Text -> Eval ctx (Value ctx)) -> (Value ctx -> Eval ctx (Value ctx)) -> Value ctx -> (Text -> Eval ctx CodePoint) -> Integer -> Text -> Eval ctx (Value ctx))
ModuleName
_ModuleName Text
"_codePointAt"
\CodePoint -> Text -> Eval ctx (Value ctx)
fallback Value ctx -> Eval ctx (Value ctx)
_ Value ctx
_ Text -> Eval ctx CodePoint
_ -> CodePoint -> Text -> Eval ctx (Value ctx)
fallback
, ModuleName
-> Text
-> (((CodePoint -> Eval ctx Bool) -> Text -> Eval ctx CodePoint)
-> (Text -> Eval ctx CodePoint)
-> (CodePoint -> Eval ctx Bool)
-> Text
-> Eval ctx CodePoint)
-> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @(((CodePoint -> Eval ctx Bool) -> Text -> Eval ctx Integer) -> (Text -> Eval ctx CodePoint) -> (CodePoint -> Eval ctx Bool) -> Text -> Eval ctx Integer)
ModuleName
_ModuleName Text
"_countPrefix"
\(CodePoint -> Eval ctx Bool) -> Text -> Eval ctx CodePoint
fallback Text -> Eval ctx CodePoint
_ -> (CodePoint -> Eval ctx Bool) -> Text -> Eval ctx CodePoint
fallback
, ModuleName
-> Text
-> ((CodePoint -> Text -> Eval ctx Text)
-> CodePoint -> Text -> Eval ctx Text)
-> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @((Integer -> Text -> Eval ctx Text) -> Integer -> Text -> Eval ctx Text)
ModuleName
_ModuleName Text
"_take"
\CodePoint -> Text -> Eval ctx Text
fallback -> CodePoint -> Text -> Eval ctx Text
fallback
, ModuleName
-> Text
-> ((Text -> Eval ctx CodePoint) -> Text -> Eval ctx CodePoint)
-> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @((Text -> Eval ctx CodePoint) -> Text -> Eval ctx CodePoint)
ModuleName
_ModuleName Text
"_unsafeCodePointAt0"
\Text -> Eval ctx CodePoint
fallback -> Text -> Eval ctx CodePoint
fallback
]