[Nix-dev] Use Haskell for Shell Scripting

Michael Raskin 7c6f434c at mail.ru
Tue Feb 10 18:22:57 CET 2015


>> Some of the shell tricks based on expansions are portable to Lisp, not
>> worth it in Julia and definitely too costly in Haskell (learning
>> Template Haskell is definitely outside my plans).
>
>I don't really know TH either.  Occasionally I use TH actions defined in
>a library (for example to derive safecopy instances or, less commonly,
>to auto-generate lenses).  But TH somehow feels wrong and ugly.

In both Julia and Common Lisp I use macros for many tasks and they make
life much more comfortable. Of course, Haskell type system may make it
hasrder to use macros.

>>> However, you may want to write type signatures anyway.  It doesn't
>>> increase your development time considerably.
>>
>> I also need to write matching to extract data from deep structures,
>> no?
>
>I'm not sure what you mean by that.  Perhaps you can drop me an off-list
>mail, so we can talk about your specific application.

Well, it looks like field names are not scoped and if I use plain ADT
I have to write pattern matching to extract data from a member of 
a member of a structure.

>>>>> 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.
>>
>> Why is it a problem? For hierarchically structured workspaces you just
>> tell XMonad core to select the low-level workspace.
>
>The trouble is that xmonad's idea of "set of workspaces" is encoded as a
>list zipper.  It does not allow me to encode the tree.  It only ever
>holds *lists* of workspaces and does not abstract over this data
>structure.

So? Keep your own structure and keep pointers to XMonad-stored entries.





More information about the nix-dev mailing list