{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}

-- | This module provide a registry with default values for parsing options
module Data.Registry.Options.Defaults where

import Data.Registry
import Data.Registry.Options.Decoder
import Data.Registry.Options.FieldConfiguration

-- | Default registry
defaults :: Registry
  '[]
  '[FieldConfiguration, Decoder Bool, Decoder Int, Decoder Text,
    Decoder String]
defaults =
  forall a. Typeable a => a -> Typed a
fun FieldConfiguration
defaultFieldConfiguration
    forall a b c. AddRegistryLike a b c => a -> b -> c
<: Registry
  '[] '[Decoder Bool, Decoder Int, Decoder Text, Decoder String]
decoders

-- | Default decoders
decoders :: Registry
  '[] '[Decoder Bool, Decoder Int, Decoder Text, Decoder String]
decoders =
  forall a.
Typeable a =>
(Text -> Either Text a) -> Typed (Decoder a)
addDecoder Text -> Either Text Bool
boolDecoder
    forall a b c. AddRegistryLike a b c => a -> b -> c
<: forall a.
Typeable a =>
(Text -> Either Text a) -> Typed (Decoder a)
addDecoder Text -> Either Text Int
intDecoder
    forall a b c. AddRegistryLike a b c => a -> b -> c
<: forall a.
Typeable a =>
(Text -> Either Text a) -> Typed (Decoder a)
addDecoder Text -> Either Text Text
textDecoder
    forall a b c. AddRegistryLike a b c => a -> b -> c
<: forall a.
Typeable a =>
(Text -> Either Text a) -> Typed (Decoder a)
addDecoder Text -> Either Text String
stringDecoder