Fancy REPL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Fancy REPL

Heinrich Apfelmus
Dear list,

the  Show  class is extremely useful for exploring Haskell in a
terminal, but sometimes, I just want something fancier. For instance,
I'm currently dabbling with sound generation and it is only natural that
I want to hear the sound instead of seeing a textual representation.
Another example would be graphics, that are simply drawn on screen
whenever you evaluate their value.

Of course, this is simple to implement with a class

     class Demonstrable a where
         demo :: a -> IO ()

     instance Demonstrable Sound where demo = play
     instance Demonstrable Sound where demo = draw
     instance Demonstrable GUI   where demo = run
     etc.


However, I don't want to reinvent the wheel, small as it may be, hence
my question: is there a package on hackage that already defines a class
similar to  Demonstrable ? Or any other projects in this direction,
like, say, a fancy REPL built on wxHaskell?


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Fancy REPL

amindfv

Does this mean we're going to see music FRP examples soon?!

amindfv / Tom

On Feb 9, 2012 2:17 PM, "Heinrich Apfelmus" <[hidden email]> wrote:
Dear list,

the  Show  class is extremely useful for exploring Haskell in a terminal, but sometimes, I just want something fancier. For instance, I'm currently dabbling with sound generation and it is only natural that I want to hear the sound instead of seeing a textual representation. Another example would be graphics, that are simply drawn on screen whenever you evaluate their value.

Of course, this is simple to implement with a class

   class Demonstrable a where
       demo :: a -> IO ()

   instance Demonstrable Sound where demo = play
   instance Demonstrable Sound where demo = draw
   instance Demonstrable GUI   where demo = run
   etc.


However, I don't want to reinvent the wheel, small as it may be, hence my question: is there a package on hackage that already defines a class similar to  Demonstrable ? Or any other projects in this direction, like, say, a fancy REPL built on wxHaskell?


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Fancy REPL

Heinrich Apfelmus
Tom Murphy wrote:
> Heinrich Apfelmus wrote:
>
>> For instance, I'm currently
>> dabbling with sound generation and it is only natural that I want to hear
>> the sound instead of seeing a textual representation.
 >
 > Does this mean we're going to see music FRP examples soon?!

I'm not so sure about the "soon" part, but yes, using FRP to make music
is part of the plan.


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Fancy REPL

serialhex
On Thu, Feb 9, 2012 at 3:04 PM, Heinrich Apfelmus <[hidden email]> wrote:

I'm not so sure about the "soon" part, but yes, using FRP to make music is part of the plan.

you know, i've been thinking about this recently, and while i need more haskell skillz if i want to do some sound synthesis, i think it would be really spiffy to work on something like that!  are you working on this privately or do you have a public repo one can clone?  a fully-haskell sound synth program would be really spiffy!!  (esp if one could code new synths in real-time in haskell....)
hex

--
*  my blog is cooler than yours: http://serialhex.github.com
*  The wise man said: "Never argue with an idiot. They bring you down to their level and beat you with experience."
*  As a programmer, it is your job to put yourself out of business. What you do today can be automated tomorrow. ~Doug McIlroy
No snowflake in an avalanche ever feels responsible. 
---
CFO: “What happens if we train people and they leave?”
CTO: “What if we don’t and they stay?”

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Fancy REPL

Heinrich Apfelmus
serialhex wrote:

> Heinrich Apfelmus wrote:
>
>> I'm not so sure about the "soon" part, but yes, using FRP to make music is
>> part of the plan.
>
> you know, i've been thinking about this recently, and while i need more
> haskell skillz if i want to do some sound synthesis, i think it would be
> really spiffy to work on something like that!  are you working on this
> privately or do you have a public repo one can clone?  a fully-haskell
> sound synth program would be really spiffy!!  (esp if one could code new
> synths in real-time in haskell....)

Folks have been doing sound synthesis in Haskell for a long time; in
particular, I'm currently building on Rohan Drape's bindings to
SuperCollider

   http://slavepianos.org/rd/ut/hsc3-texts/hsc3-tutorial.html

There's also Henning Thielemann who managed to do real-time audio
editing in Haskell by performing run-time compilation with LLVM

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


Still, I think there's a need (I certainly have it) for a simple-to-use
package that makes it really easy to play with sound synthesis in
Haskell, i.e. that supports instant gratification. I'm currently working
on a project called 'tomato-rubato' that aims to do precisely that. I'll
put up a github repo once I have something that is glued together by
duct tape rather than spit.


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe