Fix documentation

This commit is contained in:
Anupam | अनुपम 2021-04-09 17:37:34 +00:00 committed by GitHub
parent f76ab71f8c
commit 6f0215a5d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,20 +65,20 @@ unwrapDynamic :: forall a. TypeRep a -> Dynamic t -> Maybe a
It's extremely easy. You just need to create a mechanical `Tag` class instance for your datatype. There are different `Tag` classes for types of different arity.
For example, to derive an instance for a plain data type, use `Tag1` and `proxy1` -
For example, to derive an instance for a plain data type, use `Tag0` and `proxy0` -
```purescript
data Person = Person {name::String, age::Int}
instance tag1Person :: Tag1 Person where t1 = proxy1
instance tag0Person :: Tag0 Person where t0 = proxy0
```
For a data type which takes one type parameter, use `Tag2` and `proxy2`, and so on -
For a data type which takes one type parameter, use `Tag1` and `proxy1`, and so on -
```purescript
data Optional a = Some a | None
instance tag2Optional :: Tag2 Optional where t2 = proxy2
instance tag1Optional :: Tag1 Optional where t1 = proxy1
```
**Don't worry about getting it wrong since the type system will prevent you from writing an invalid instance.**