[Haskell-cafe] ANN: wizards-1.0: A High level, generic library for interrogative user interfaces

2012-07-01 Thread Liam O'Connor
Hi all,

wizards is an Haskell library designed for the quick and painless development 
of interrogative programs, which revolve around a dialogue with the user, who 
is asked a series of questions in a sequence much like an installation wizard.

Everything from interactive system scripts, to installation wizards, to 
full-blown shells can be implemented with the support of wizards.

It is developed transparently on top of a free monad (see Swierstra's excellent 
paper on this topic at 
http://www.cs.ru.nl/~W.Swierstra/Publications/DataTypesALaCarte.pdf), which 
separates out the semantics of the program from the wizards interface. A 
variety of backends exist, including a full featured backend for Haskeline, a 
debug-friendly simpler implementation in terms of System.IO primitives, and a 
completely pure implementation modelled as a function from an input string to 
output. It is also possible to write your own backends, or extend the existing 
back-ends with new features.

While both built-in IO backends operate on a console, there is no reason why 
wizards cannot also be used for making GUI wizard interfaces.

The library is highly extensible - back-ends can be written or extended with 
the type system helpfully tracking what features are supported by which 
back-ends. 

Installation instructions and some educational examples are at the github page:

https://github.com/liamoc/wizards

Information on how to write backends or extend backends, as well as structured 
API documentation is available on Hackage:

http://hackage.haskell.org/package/wizards

(Or, you can just run cabal haddock to generate the documentation from the 
source).

Regards,
Liam O'Connor


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: wizards-1.0: A High level, generic library for interrogative user interfaces

2012-07-01 Thread Krzysztof Skrzętnicki
Hello,

This library looks very nice. Thank you for realeasing it! I realise it
took quite an effort to write it.

Looking from examples on Github I noticed that you use
-XOverlappingInstances. Why do you need such extension?

Best regards,
Krzysztof Skrzętnicki

On Sun, Jul 1, 2012 at 10:17 AM, Liam O'Connor lia...@cse.unsw.edu.auwrote:

 Hi all,

 wizards is an Haskell library designed for the quick and painless
 development of interrogative programs, which revolve around a dialogue
 with the user, who is asked a series of questions in a sequence much like
 an installation wizard.

 Everything from interactive system scripts, to installation wizards, to
 full-blown shells can be implemented with the support of wizards.

 It is developed transparently on top of a free monad (see Swierstra's
 excellent paper on this topic at
 http://www.cs.ru.nl/~W.Swierstra/Publications/DataTypesALaCarte.pdf),
 which separates out the semantics of the program from the wizards
 interface. A variety of backends exist, including a full featured backend
 for Haskeline, a debug-friendly simpler implementation in terms of
 System.IO primitives, and a completely pure implementation modelled as a
 function from an input string to output. It is also possible to write your
 own backends, or extend the existing back-ends with new features.

 While both built-in IO backends operate on a console, there is no reason
 why wizards cannot also be used for making GUI wizard interfaces.

 The library is highly extensible - back-ends can be written or extended
 with the type system helpfully tracking what features are supported by
 which back-ends.

 Installation instructions and some educational examples are at the github
 page:

 https://github.com/liamoc/wizards

 Information on how to write backends or extend backends, as well as
 structured API documentation is available on Hackage:

 http://hackage.haskell.org/package/wizards

 (Or, you can just run cabal haddock to generate the documentation from the
 source).

 Regards,
 Liam O'Connor


 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: wizards-1.0: A High level, generic library for interrogative user interfaces

2012-07-01 Thread Liam O'Connor
I know it's somewhat evil (:P), but I was unable to implement the subsumption 
constraints (::) in a way that avoided it. It's there because I'm (ab)using 
the type-class system to do computation (specifically an O(n) search though 
long chain of coproducts for a specific constructor). E.g, determining Foo :: 
Bar :+: Foo :+: Baz. There may be a way to rearrange the type level stuff to 
make it go away, perhaps with some new type extensions in 7.4 that I haven't 
studied extensively yet.  

This is also a problem in Swierstra's original paper where he introduces this 
technique. In practice, it doesn't pose a problem, because you're not meant to 
define your own instances of :: anyway, and you shouldn't care what order the 
constructors occur.  

Regards,
Liam O'Connor


On Sunday, 1 July 2012 at 6:37 PM, Krzysztof Skrzętnicki wrote:

 Hello,
  
 This library looks very nice. Thank you for realeasing it! I realise it took 
 quite an effort to write it.
  
 Looking from examples on Github I noticed that you use 
 -XOverlappingInstances. Why do you need such extension?
  
 Best regards,
 Krzysztof Skrzętnicki
  
 On Sun, Jul 1, 2012 at 10:17 AM, Liam O'Connor lia...@cse.unsw.edu.au 
 (mailto:lia...@cse.unsw.edu.au) wrote:
  Hi all,
   
  wizards is an Haskell library designed for the quick and painless 
  development of interrogative programs, which revolve around a dialogue 
  with the user, who is asked a series of questions in a sequence much like 
  an installation wizard.
   
  Everything from interactive system scripts, to installation wizards, to 
  full-blown shells can be implemented with the support of wizards.
   
  It is developed transparently on top of a free monad (see Swierstra's 
  excellent paper on this topic at 
  http://www.cs.ru.nl/~W.Swierstra/Publications/DataTypesALaCarte.pdf 
  (http://www.cs.ru.nl/%7EW.Swierstra/Publications/DataTypesALaCarte.pdf)), 
  which separates out the semantics of the program from the wizards 
  interface. A variety of backends exist, including a full featured backend 
  for Haskeline, a debug-friendly simpler implementation in terms of 
  System.IO primitives, and a completely pure implementation modelled as a 
  function from an input string to output. It is also possible to write your 
  own backends, or extend the existing back-ends with new features.
   
  While both built-in IO backends operate on a console, there is no reason 
  why wizards cannot also be used for making GUI wizard interfaces.
   
  The library is highly extensible - back-ends can be written or extended 
  with the type system helpfully tracking what features are supported by 
  which back-ends.
   
  Installation instructions and some educational examples are at the github 
  page:
   
  https://github.com/liamoc/wizards
   
  Information on how to write backends or extend backends, as well as 
  structured API documentation is available on Hackage:
   
  http://hackage.haskell.org/package/wizards
   
  (Or, you can just run cabal haddock to generate the documentation from the 
  source).
   
  Regards,
  Liam O'Connor
   
   
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org (mailto:Haskell-Cafe@haskell.org)
  http://www.haskell.org/mailman/listinfo/haskell-cafe
  




___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: wizards-1.0: A High level, generic library for interrogative user interfaces

2012-07-01 Thread Anton Kholomiov
You have implemented very general idea as
a part of your library (Data type a la carte).
Maybe it's better to make a separate package?
Other developers would benefit from it. I saw some other
packages and they implement it too.


Anton


2012/7/1 Liam O'Connor lia...@cse.unsw.edu.au

 I know it's somewhat evil (:P), but I was unable to implement the
 subsumption constraints (::) in a way that avoided it. It's there because
 I'm (ab)using the type-class system to do computation (specifically an O(n)
 search though long chain of coproducts for a specific constructor). E.g,
 determining Foo :: Bar :+: Foo :+: Baz. There may be a way to rearrange
 the type level stuff to make it go away, perhaps with some new type
 extensions in 7.4 that I haven't studied extensively yet.

 This is also a problem in Swierstra's original paper where he introduces
 this technique. In practice, it doesn't pose a problem, because you're not
 meant to define your own instances of :: anyway, and you shouldn't care
 what order the constructors occur.

 Regards,
 Liam O'Connor


 On Sunday, 1 July 2012 at 6:37 PM, Krzysztof Skrzętnicki wrote:

  Hello,
 
  This library looks very nice. Thank you for realeasing it! I realise it
 took quite an effort to write it.
 
  Looking from examples on Github I noticed that you use
 -XOverlappingInstances. Why do you need such extension?
 
  Best regards,
  Krzysztof Skrzętnicki
 
  On Sun, Jul 1, 2012 at 10:17 AM, Liam O'Connor 
  lia...@cse.unsw.edu.au(mailto:
 lia...@cse.unsw.edu.au) wrote:
   Hi all,
  
   wizards is an Haskell library designed for the quick and painless
 development of interrogative programs, which revolve around a dialogue
 with the user, who is asked a series of questions in a sequence much like
 an installation wizard.
  
   Everything from interactive system scripts, to installation wizards,
 to full-blown shells can be implemented with the support of wizards.
  
   It is developed transparently on top of a free monad (see Swierstra's
 excellent paper on this topic at
 http://www.cs.ru.nl/~W.Swierstra/Publications/DataTypesALaCarte.pdf (
 http://www.cs.ru.nl/%7EW.Swierstra/Publications/DataTypesALaCarte.pdf)http://www.cs.ru.nl/%7EW.Swierstra/Publications/DataTypesALaCarte.pdf%29),
 which separates out the semantics of the program from the wizards
 interface. A variety of backends exist, including a full featured backend
 for Haskeline, a debug-friendly simpler implementation in terms of
 System.IO primitives, and a completely pure implementation modelled as a
 function from an input string to output. It is also possible to write your
 own backends, or extend the existing back-ends with new features.
  
   While both built-in IO backends operate on a console, there is no
 reason why wizards cannot also be used for making GUI wizard interfaces.
  
   The library is highly extensible - back-ends can be written or
 extended with the type system helpfully tracking what features are
 supported by which back-ends.
  
   Installation instructions and some educational examples are at the
 github page:
  
   https://github.com/liamoc/wizards
  
   Information on how to write backends or extend backends, as well as
 structured API documentation is available on Hackage:
  
   http://hackage.haskell.org/package/wizards
  
   (Or, you can just run cabal haddock to generate the documentation from
 the source).
  
   Regards,
   Liam O'Connor
  
  
   ___
   Haskell-Cafe mailing list
   Haskell-Cafe@haskell.org (mailto:Haskell-Cafe@haskell.org)
   http://www.haskell.org/mailman/listinfo/haskell-cafe
 




 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] package to expand TH macros?

2012-07-01 Thread Eric
I seem to remember finding a package a few days ago that would take Haskell 
source with TH, then run and expand the TH macros in-place to produce 
equivalent, TH-free Haskell source.  

I just went through the Hackage package list and didn't find anything like that.

Did I imagine it?  Or can anyone remind me its name?

thanks,
--Eric___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] package to expand TH macros?

2012-07-01 Thread Brandon Allbery
On Sun, Jul 1, 2012 at 1:56 PM, Eric devnull1...@yahoo.com wrote:

  I seem to remember finding a package a few days ago that would take
 Haskell source with TH, then run and expand the TH macros in-place to
 produce equivalent, TH-free Haskell source.


It is kinda hard to find for some reason...  you're looking for ZeroTH,
http://hackage.haskell.org/package/zeroth

-- 
brandon s allbery  allber...@gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] package to expand TH macros?

2012-07-01 Thread Chaddaï Fouché
On Sun, Jul 1, 2012 at 8:11 PM, Brandon Allbery allber...@gmail.com wrote:
 On Sun, Jul 1, 2012 at 1:56 PM, Eric devnull1...@yahoo.com wrote:

 I seem to remember finding a package a few days ago that would take
 Haskell source with TH, then run and expand the TH macros in-place to
 produce equivalent, TH-free Haskell source.


 It is kinda hard to find for some reason...  you're looking for ZeroTH,
 http://hackage.haskell.org/package/zeroth


It should probably at least have the Template Haskell category...

-- 
Jedaï

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] how to check thunk

2012-07-01 Thread 山本和彦
Hello,

Are there any ways to see if a value is a thunk or memorized?
I would like to have a function like:
  isThunk :: a - IO Bool

I'm implementing some data structures described in Purely Functional
Data Structures and want to check my implementation is correct.
E.g.

https://gist.github.com/2987425

Thanks.

--Kazu

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] how to check thunk

2012-07-01 Thread Chaddaï Fouché
On Mon, Jul 2, 2012 at 5:29 AM, Kazu Yamamoto k...@iij.ad.jp wrote:
 Hello,

 Are there any ways to see if a value is a thunk or memorized?
 I would like to have a function like:
   isThunk :: a - IO Bool


vacuum allow that and much more though I don't know if it still works
correctly on GHC 7.4. Anyway your isThunk is

 isThunk a = fmap GHC.Vacuum.ClosureType.isThunk GHC.Vacuum.closureType

(Feel free to arrange your imports to make that a bit more readable ;)

http://hackage.haskell.org/package/vacuum
-- 
Jedaï

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] how to check thunk

2012-07-01 Thread 山本和彦
Hello,

 vacuum allow that and much more though I don't know if it still works
 correctly on GHC 7.4. Anyway your isThunk is
 
 isThunk a = fmap GHC.Vacuum.ClosureType.isThunk GHC.Vacuum.closureType

Great. I confirmed that this works with GHC 7.4.
# I removed the a parameter.

Thank you very much!

--Kazu

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe