Module
OhYes
- Package
- purescript-ohyes
- Repository
- justinwoo/purescript-ohyes
#generateTS Source
generateTS :: forall a. HasTSRep a => String -> Proxy a -> StringGenerate Typescript type signatures for a given type, supplying a name to use as the type name
#VariantRecord Source
newtype VariantRecord (pairings :: Row Type)VariantRecord to represent a union of records of string literal "tag" and dependently-typed "content".
Constructors
VariantRecord { content :: Foreign, tag :: String }
Instances
(RowToList row rl, FakeSumRecordMembers rl) => HasTSRep (VariantRecord row)
#overVariant Source
overVariant :: forall row. (Variant row -> Variant row) -> VariantRecord row -> VariantRecord rowA function to apply a function on the Variant form of the VariantRecord.
#toVariant Source
toVariant :: forall row. VariantRecord row -> Variant row#fromVariant Source
fromVariant :: forall row. Variant row -> VariantRecord row#HasTSRep Source
class HasTSRep a whereOur 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
#HasTSRepFields Source
class HasTSRepFields (rl :: RowList) whereMembers
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) whereMembers
toFakeSumRecordMembers :: RLProxy rl -> List String
Instances
(FakeSumRecordMembers tail, IsSymbol name, HasTSRep ty) => FakeSumRecordMembers (Cons name ty tail)FakeSumRecordMembers Nil
- Modules
- OhYes