{- Data/Singletons/Prelude/Util.hs

(c) Richard Eisenberg 2013
rae@cs.brynmawr.edu

This file contains helper functions internal to the singletons-base package.
Users of the package should not need to consult this file.
-}

{-# LANGUAGE TemplateHaskellQuotes #-}
module Data.Singletons.Base.Util where

import Data.Functor.Identity
import Data.List.NonEmpty (NonEmpty(..))
import qualified Data.Monoid as Monoid
import Data.Semigroup as Semigroup
import Data.Void
import Language.Haskell.TH

-- The list of types that singletons-base processes by default
basicTypes :: [Name]
basicTypes :: [Name]
basicTypes = [ ''Maybe
             , ''[]
             , ''Either
             , ''NonEmpty
             , ''Void
             ] [Name] -> [Name] -> [Name]
forall a. [a] -> [a] -> [a]
++ [Name]
boundedBasicTypes

boundedBasicTypes :: [Name]
boundedBasicTypes :: [Name]
boundedBasicTypes =
            [ ''(,)
            , ''(,,)
            , ''(,,,)
            , ''(,,,,)
            , ''(,,,,,)
            , ''(,,,,,,)
            , ''Identity
            ] [Name] -> [Name] -> [Name]
forall a. [a] -> [a] -> [a]
++ [Name]
enumBasicTypes

enumBasicTypes :: [Name]
enumBasicTypes :: [Name]
enumBasicTypes = [ ''Bool, ''Ordering, ''() ]

semigroupBasicTypes :: [Name]
semigroupBasicTypes :: [Name]
semigroupBasicTypes
  = [ ''Dual
    , ''All
    , ''Any
    , ''Sum
    , ''Product
    -- , ''Endo      see https://github.com/goldfirere/singletons/issues/82
    {- , ''Alt       singletons-th doesn't support higher kinds :(
                     see https://github.com/goldfirere/singletons/issues/150
    -}

    , ''Min
    , ''Max
    , ''Semigroup.First
    , ''Semigroup.Last
    , ''WrappedMonoid
    ]

monoidBasicTypes :: [Name]
monoidBasicTypes :: [Name]
monoidBasicTypes
  = [ ''Monoid.First
    , ''Monoid.Last
    ]