{-# LANGUAGE BlockArguments      #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications    #-}
{-# LANGUAGE ViewPatterns        #-}

module Dovetail.Core.Data.Bounded where

import Data.Foldable (fold)
import Dovetail
import Dovetail.Evaluate (builtIn)

env :: forall ctx. Env ctx
env :: Env ctx
env = do
  let _ModuleName :: ModuleName
_ModuleName = Text -> ModuleName
ModuleName Text
"Data.Bounded"

  [Env ctx] -> Env ctx
forall (t :: * -> *) m. (Foldable t, Monoid m) => t m -> m
fold
    [ -- topInt :: Int
      ModuleName -> Text -> Integer -> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @Integer
        ModuleName
_ModuleName Text
"topInt"
        Integer
2147483647
      -- bottomInt :: Int
    , ModuleName -> Text -> Integer -> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @Integer
        ModuleName
_ModuleName Text
"bottomInt"
        (-Integer
2147483648)
      -- topChar :: Char
    , ModuleName -> Text -> Char -> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @Char
        ModuleName
_ModuleName Text
"topChar"
        (Bounded Char => Char
forall a. Bounded a => a
maxBound @Char)
      -- bottomChar :: Char
    , ModuleName -> Text -> Char -> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @Char
        ModuleName
_ModuleName Text
"bottomChar"
        (Bounded Char => Char
forall a. Bounded a => a
minBound @Char)
      -- topNumber :: Number
    , ModuleName -> Text -> Double -> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @Double
        ModuleName
_ModuleName Text
"topNumber"
        (Double -> Double
forall a. Fractional a => a -> a
recip Double
0)
      -- bottomNumber :: Number
    , ModuleName -> Text -> Double -> Env ctx
forall ctx a. ToValue ctx a => ModuleName -> Text -> a -> Env ctx
builtIn @ctx @Double
        ModuleName
_ModuleName Text
"bottomNumber"
        (-(Double -> Double
forall a. Fractional a => a -> a
recip Double
0))
    ]