
Hi Tom,
this indeed led to more questions. I believe that was happening because x
is not a list of concrete types. In determining the concrete type of the
list GHCI evaluated all values hence
λ> let foo = [1,2,3] :: [Int]
Prelude|
foo :: [Int]
λ> :sprint foo
foo = [1,2,3]
I tried on other concrete types like [Char] and String...seems like [Char]
is not entire the same as String after all
λ> let x = ['a','b','c']
Prelude|
x :: [Char]
λ> let y = "abc"
Prelude|
y :: [Char]
λ> :sprint x
x = "abc"
λ> :sprint y
y = _
On Sun, Oct 9, 2016 at 8:00 PM,
Send Beginners mailing list submissions to beginners@haskell.org
To subscribe or unsubscribe via the World Wide Web, visit http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-request@haskell.org
You can reach the person managing the list at beginners-owner@haskell.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Basic sound playing on Windows? (Tilmann) 2. Re: Basic sound playing on Windows? (Cleverson Casarin Uliana) 3. Lazy evaluation, trying to find out when its done (Lai Boon Hui) 4. Re: Lazy evaluation, trying to find out when its done (Tom Murphy)
----------------------------------------------------------------------
Message: 1 Date: Sat, 8 Oct 2016 15:19:35 +0200 From: Tilmann
To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell Subject: Re: [Haskell-beginners] Basic sound playing on Windows? Message-ID: <417e430b-14d5-1bda-217d-1df8e512831d@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed I used ALUT on OSX and it worked perfectly. Not used it on windows yet, but according to the documentation it's supported.
Have a look here for how to use it on windows:
https://hackage.haskell.org/package/OpenAL
and here for some examples:
https://github.com/haskell-openal/ALUT/tree/master/examples/Basic
Best,
Tilmann
Am 06.10.16 um 17:17 schrieb Cleverson Casarin Uliana:
Hello all, is it easy to play/stop sound wave files on Windows? For now I'd like just playing and stopping them assynchronously. Do I need to install any package besides Haskell Platform?
Thanks, Cleverson _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
Message: 2 Date: Sat, 8 Oct 2016 10:54:54 -0300 From: Cleverson Casarin Uliana
To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell Subject: Re: [Haskell-beginners] Basic sound playing on Windows? Message-ID: <46d55c3c-0c5c-e1e1-c413-1406ec12a56c@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Thank you Tilmann, it's quite good.
Greetings, Cleverson
------------------------------
Message: 3 Date: Sun, 9 Oct 2016 10:27:22 +0800 From: Lai Boon Hui
To: beginners@haskell.org Subject: [Haskell-beginners] Lazy evaluation, trying to find out when its done Message-ID: Content-Type: text/plain; charset="utf-8" Hi all,
I understand that the take method will evaluate the value inside the cons cell whereas length will just evaluate the spine or structure of the list
λ> let y = "abc" Prelude| y :: [Char] λ> :sprint y y = _ λ> take 1 y "a" it :: [Char] λ> :sprint y y = 'a' : _ λ>
Well and good but why doesn't the same work on a list of Nums??
λ> let x = [1,2,3] Prelude| x :: Num t => [t] λ> :sprint x x = _ λ> take 1 x [1] it :: Num a => [a] λ> :sprint x x = _ λ>
I expected to see x = 1 : _
-- Best Regards, Boon Hui