Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Haskell
Wiki community
Recent changes
Random page
HaskellWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
CTRex
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Comparison with other approaches = Here we compare with other approaches. == HList records == The [http://hackage.haskell.org/package/HList HList package] provides [http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-Record.html extensible records] build on heterogeneous lists. The differences with are as follows: * Rows are not sorted. This has the following downsides: ** Compile time operations, such as reordering the labels and checking for duplicate labels is costly (at compile time) [http://code.haskell.org/~aavogt/HList-benchmark/a.html link] ** <hask>{x = 0, y = 0 }</hask> and <hask>{ y = 0, x = 0 } </hask> do not have the same type. Hence, is we give a type declaration for the first and want to put in the latter, we need to call a manual conversion function. * Constrained row operations are less convenient, since ** the Record newtype needs to be unwrapped, and ** there is no definition provided to create instances of [http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-FakePrelude.html#t:ApplyAB applyAB] that work on <hask>LVPair l a</hask> from instances that work on just <hask>a</hask> ** however there similarities between the two {| ! CTRex function ! HList function(s) |- | rinit | [http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-HList.html#g:15 hReplicate] |- | erase | [http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-HList.html#t:HMapOut hMapOut] |- | eraseZip | [http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-HZip.html hZip] with hMapOut |} * Currently, the run time complexity of extend, restriction and lookup is O(n), versus O(log n) for CTRex. Proposals have been done to make this faster [http://www.fing.edu.uy/~mviera/papers/pepm13.pdf paper]. * Duplicate labels are disallowed in HList. * HList has nicer support for [http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-MakeLabels.html writing labels] == Trex (Hugs) == The Haskell interpreter hugs supports a type system extension that allows extensible records. The differences are as follows: * Constrained row operations are not available(?) * Duplicate labels are disallowed * Record merge not available (?) * Can pattern match on records(?) * Nicer syntax * More (?) == More == More to come! Please add stuff!
Summary:
Please note that all contributions to HaskellWiki are considered to be released under simple permissive license (see
HaskellWiki:Copyrights
for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
Cancel
Editing help
(opens in new window)
Toggle limited content width