Module
OhYes
- Package
- purescript-ohyes
- Repository
- justinwoo/purescript-ohyes
#generateTS Source
generateTS :: forall a. HasTSRep a => String -> Proxy a -> String
Generate Typescript type signatures for a given type, supplying a name to use as the type name
#HasTSRep Source
class (HasJSRep a) <= HasTSRep a where
Our main type class for types that can be represented in Typescript types without conversion. You may want to using newtype instance deriving for this class for your newtypes, but any other types should be tested for correctness.
Members
Instances
HasTSRep Number
HasTSRep String
HasTSRep Boolean
(HasTSRep a) => HasTSRep (Nullable a)
(HasTSRep a) => HasTSRep (Array a)
(HasTSRep a, HasTSRep b) => HasTSRep (a -> b)
(HasTSRep a, HasTSRep b, HasTSRep c) => HasTSRep (Fn2 a b c)
(RowToList row rl, MembersHaveJSRep rl, HasTSRepFields rl) => HasTSRep (Record row)
(RowToList row rl, MembersHaveJSRep rl, FakeSumRecordMembers rl) => HasTSRep (Variant row)
#HasTSRepFields Source
class HasTSRepFields (rl :: RowList) where
Members
toTSRepFields :: RLProxy rl -> List String
Instances
(HasTSRepFields tail, IsSymbol name, HasTSRep ty) => HasTSRepFields (Cons name ty tail)
HasTSRepFields Nil
#FakeSumRecordMembers Source
class FakeSumRecordMembers (rl :: RowList) where
Members
toFakeSumRecordMembers :: RLProxy rl -> List String
Instances
(FakeSumRecordMembers tail, IsSymbol name, HasTSRep ty) => FakeSumRecordMembers (Cons name ty tail)
FakeSumRecordMembers Nil
- Modules
- OhYes
a Variant is represented by VariantRep, which is a newtype record of
newtype VariantRep a = VariantRep { type ∷ String , value ∷ a }
as seen here: https://github.com/natefaubion/purescript-variant/blob/aef507e2972d294ecd735575371eccbc61ac1ac4/src/Data/Variant/Internal.purs#L31