@@ -21,7 +21,7 @@ module TypedEnv
21
21
import Prelude
22
22
import Data.Either (Either , note )
23
23
import Data.Generic.Rep (class Generic )
24
- import Data.Generic.Rep. Show (genericShow )
24
+ import Data.Show.Generic (genericShow )
25
25
import Data.Int (fromString ) as Int
26
26
import Data.Maybe (Maybe (..))
27
27
import Data.Number (fromString ) as Number
@@ -30,7 +30,7 @@ import Data.String.Common (toLower)
30
30
import Data.Symbol (class IsSymbol , SProxy (..), reflectSymbol )
31
31
import Foreign.Object (Object , lookup )
32
32
import Prim.Row (class Cons , class Lacks ) as Row
33
- import Prim.RowList (class RowToList , kind RowList , Cons , Nil )
33
+ import Prim.RowList (class RowToList , RowList , Cons , Nil )
34
34
import Record (insert ) as Record
35
35
import Type.Data.RowList (RLProxy (..))
36
36
import Type.Equality (class TypeEquals , to )
@@ -66,6 +66,7 @@ envErrorMessage = case _ of
66
66
EnvParseError var -> " The variable \" " <> var <> " \" was formatted incorrectly."
67
67
68
68
-- | Useful for a type alias representing a resolved environment
69
+ type Resolved :: forall k . Symbol -> k -> k
69
70
type Resolved (name :: Symbol ) ty = ty
70
71
71
72
-- | Parses a `String` value to the specified type.
@@ -110,7 +111,7 @@ else instance readValueRequired :: ParseValue a => ReadValue a where
110
111
>>= (parseValue >>> note (EnvParseError name))
111
112
112
113
-- | Transforms a row of environment variable specifications to a record.
113
- class ReadEnv (e :: # Type ) (r :: # Type ) where
114
+ class ReadEnv (e :: Row Type ) (r :: Row Type ) where
114
115
readEnv :: forall proxy . proxy e -> Object String -> Either EnvError (Record r )
115
116
116
117
instance readEnvImpl ::
@@ -123,7 +124,7 @@ instance readEnvImpl ::
123
124
readEnv _ = readEnvFields (RLProxy :: RLProxy el ) (RLProxy :: RLProxy rl )
124
125
125
126
-- | Transforms a list of environment variable specifications to a record.
126
- class ReadEnvFields (el :: RowList ) (rl :: RowList ) (r :: # Type ) | el -> rl where
127
+ class ReadEnvFields (el :: RowList Type ) (rl :: RowList Type ) (r :: Row Type ) | el -> rl where
127
128
readEnvFields
128
129
:: forall proxy
129
130
. proxy el
0 commit comments