>>> Data type declarations are not free in any case, I think. >> >> Compared to what? Algebraic abstractions usually compile to exactly >> the code you would have written if you had not used abstraction. > > Data type declarations have to be written. Store-everything-in-hash- > tables is slower but quicker to write as long as I can keep the entire > program structure in my head. > > Also I am trying to learn to write reasonable Haskell code for a small > data-crunching script without just "writing Fortran into Haskell"; > well, many of its features are minor annoyances in that mode even if > they are useful for giving structure to a large program.
It's seldom that you have to write your own data types, if you don't want to. Basic types, functions, products and coproducts can express anything you want that isn't a tightly packed array of machine words. But if you really want to dump everything into a table-like data structure, you can use Data.Map or Data.IntMap for everything. Together with GHC's OverloadedLists extension this should make your code just as short as the usual everything-is-a-hash-table in most scripting languages. However, you may want to write type signatures anyway. It doesn't increase your development time considerably. >>> Well, you started talking like you were considering some limitation >>> of XMonad hard to work around. >> >> I am. I'm using a tree-shaped set of workspaces, but I need to >> encode this tree within the names of the workspaces, which is >> incredibly awkward. > > Well, I think you should be able just to write alternative UI for > workspace selection simply ignoring the old one, no? Unfortunately not. Everything in xmonad goes through the core data structure StackSet.
signature.asc
Description: PGP signature
_______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
