HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

Applications and libraries/Generic programming/SyB

< Applications and libraries | Generic programming

Contents

1 Approach: Scrap your Boilerplate (SyB) and Variants

References

2 Required features/Portability

For all proposals:

Rank-2 types are supported by GHC and Hugs and are going to be part of Haskell'.

2.1 SyB1 and SyB2

Type-safe cast is implemented in GHC. However other compilers do not support it and it is not going to be part of Haskell'.

2.2 SyB3

Multiple-parameter type classes are supported in GHC and Hugs and should be part of Haskell'. (Note that this is a rare example where functional dependencies are NOT required. So regardles of the outcome of the FD/AT debate, this extension is likely to be supported in Haskell'.)

Explicit type application is also a relatively minor extension, requiring EmptyDataDecls (also likely to be a part of Haskell') to be encoded.

Type class abstraction could be an extension on its own but there is no Haskell implementation that actually supports it. However, type class abstraction can be emulated using MPTC.

SyB3 also requires the restriction on instance declarations to be relaxed in two ways: undecidable instances allow type classes constraints to be satisfied coinductively (the translation generates a recursive dictionary.)

Secondly, SyB3 relies on overlapping instances to override generic definitions of type-indexed functions for specific types. Overlapping instances are not an essential part of SyB, but they do simplify the use of type-indexed operations.

Questions:

- Is Haskell' going to relax the constraints on type class instances? If so, will SyB instances be valid Haskell' code?

2.3 SyB Reloaded and Revolutions (SyBRR)

GADTs are required for the type representations (Spine view and variants). GHC supports GADTs and they may be part of Haskell'.

3 Expressibility

4 Subset of data types covered

5 Usage

6 Error Messages

Users of SyB can probably give a better comment about error messages.

7 Amount of work per data type (Boilerplate)

8 Extensibility

(Need to define statically vs dynamically extensibility).

9 Reasoning

10 Performance considerations

11 Helpful extra features

TODO (users may have good ideas for this section)

12 Discussion

TODO

Retrieved from "http://www.haskell.org/haskellwiki/Applications_and_libraries/Generic_programming/SyB"

This page has been accessed 405 times. This page was last modified 12:52, 11 May 2007. Recent content is available under a simple permissive license.