Advantages and disadvantages of each are explored here.
- Support arbitrary number of fields
- Supports projecting and narrow and things like that quite well
- Apparently supports lens
- Field order doesn't change the type
-
Requires you to declare fields ahead of time
-
Apparently takes up runtime space
-
Types are fairly complex
-
Creating values is kind of a drag (lots of operators and nil):
(SName =:: "tucker") :& (SAge =:: 9) :& (SSleeping =:: True) :& (SMaster =:: jon) :& RNil
-
Likely supports projection
- Type inference is good?
- Has rows? Like
Has field record => record -> ...
. Unclear from the docs.
- Does not require you to declare fields ahead of time
- No runtime overhead over regular tuples
- Supports projection
- Supports lenses via
lens #foo
e.g.set (lens #foo . lens #bar) .. ..
- Type inference is good
- Type signatures are short:
("foo" := Int, "bar" := String)
- Creating values is trivial:
(#foo := 123, #bar := "hi")
- Supports rows:
(Has "foo" r, Has "bar" r) => r -> ...
- Field order matters
- Instance explosion for
Has
class: haddocks - Only supports 24 fields at a time
- A limited number of fields (like labels)
- Does not require you to declare fields ahead of time
- Types are simple
- Supports (or: requires) lenses
- Field order matters
- Doesn't require declaring fields ahead of time
- Requires a preprocessor (for creating types, values, updates, etc.)
- Type inference is good
- Value creation is pretty clean syntax
- Doesn't support projection/narrowing/reshaping
- Supports rows? Unknown
- Supports composable setters/getters
- Supports "rows" like
(HasName r, HasAge r) => r -> ...
- Requires declaring things ahead of time
- Isn't really a record system
- Doesn't support projection/narrowing/reshaping