Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. What does "(# #)" mean? (John M. Dlugosz)
2. Re: What does "(# #)" mean? (Emanuel Koczwara)
3. Re: What does "(# #)" mean? (Brandon Allbery)
4. Re: What does "(# #)" mean? (John M. Dlugosz)
5. Re: What does "(# #)" mean? (Christopher Allen)
6. Re: What does "(# #)" mean? (John M. Dlugosz)
7. Re: iterated function value sequence (John M. Dlugosz)
8. Re: iterated function value sequence (Bob Ippolito)
----------------------------------------------------------------------
Message: 1
Date: Sat, 05 Apr 2014 10:13:00 -0500
From: "John M. Dlugosz" <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] What does "(# #)" mean?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed
The sources I've learned about thus far are not helping me with this one.
What's "(# #)"?
Haskell is search-hostile.
------------------------------
Message: 2
Date: Sat, 05 Apr 2014 17:20:27 +0200
From: Emanuel Koczwara <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] What does "(# #)" mean?
Message-ID: <1396711227.10143.2.camel@emanuel-laptop>
Content-Type: text/plain; charset="UTF-8"
Hi,
Dnia 2014-04-05, sob o godzinie 10:13 -0500, John M. Dlugosz pisze:
> The sources I've learned about thus far are not helping me with this one.
> What's "(# #)"?
> Haskell is search-hostile.
>
Can you provide some context? It looks like ordinary string
"(# #)" :: String
or
"(# #)" :: [Char]
Emanuel
------------------------------
Message: 3
Date: Sat, 5 Apr 2014 11:26:12 -0400
From: Brandon Allbery <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] What does "(# #)" mean?
Message-ID:
<cakfcl4vx8nnzenmkvrfeh_pqyepkdbpez7fda7xrfsol0x-...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Sat, Apr 5, 2014 at 11:13 AM, John M. Dlugosz
<[email protected]>wrote:
> The sources I've learned about thus far are not helping me with this one.
> What's "(# #)"?
> Haskell is search-hostile.
>
http://symbolhound.com :p
It's an unboxed tuple, a type that is used internally (anything named with
a # is GHC internals). You can't work with it normally (you need an
extension to use the MagicHash), and it has a number of restrictions since
most things require a constructor but an unboxed tuple doesn't have one.
--
brandon s allbery kf8nh sine nomine associates
[email protected] [email protected]
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140405/1a2f47e6/attachment-0001.html>
------------------------------
Message: 4
Date: Sat, 05 Apr 2014 10:28:00 -0500
From: "John M. Dlugosz" <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] What does "(# #)" mean?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 4/5/2014 10:26 AM, Brandon Allbery wrote:
> On Sat, Apr 5, 2014 at 11:13 AM, John M. Dlugosz <[email protected]
> <mailto:[email protected]>> wrote:
>
> The sources I've learned about thus far are not helping me with this one.
> What's "(# #)"?
> Haskell is search-hostile.
>
>
> http://symbolhound.com :p
Hmm, I tried symbolhound, and only found pseudocode and parenthetical remarks
that
happened to begin with a #, or bullet points.
>
> It's an unboxed tuple, a type that is used internally (anything named with a
> # is GHC
> internals). You can't work with it normally (you need an extension to use the
> MagicHash),
> and it has a number of restrictions since most things require a constructor
> but an unboxed
> tuple doesn't have one.
>
> --
> brandon s allbery kf8nh sine nomine associates
> [email protected] <mailto:[email protected]> [email protected]
> <mailto:[email protected]>
> unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
>
>
------------------------------
Message: 5
Date: Sat, 5 Apr 2014 10:31:37 -0500
From: Christopher Allen <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] What does "(# #)" mean?
Message-ID:
<cadnndoplu6-oodvih7hyt+z9ownlxhorwy2cwrzkbhphjmw...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
The user meant unboxed tuples, not a literal string. Try not to give the
questioner the benefit of the doubt and search for a better answer than,
"there's quotes, it must be a string rather than them trying to contain the
syntax they want to express!"
Anyway, Haskell isn't search hostile, Google is Haskell hostile. You can
use Symbolhound to search for symbols in web pages.
Search I used to get your answer:
http://symbolhound.com/?q=tuple+%28%23+%23%29+Haskell
What is most likely your answer:
http://www.haskell.org/ghc/docs/latest/html/users_guide/primitives.html#unboxed-tuples
Further reading:
Kinds, reference types, and value types in Haskell. Also, Alan Watts.
Double is a reference type of Kind *
Double# is an unboxed value type of Kind #
Types in Haskell default to *. This is what you want usually. Value types
are an after-the-fact optimization that shouldn't be done without the
guidance of a well-designed benchmark suite.
But yeah, not a string.
--- Chris Allen
On Sat, Apr 5, 2014 at 10:20 AM, Emanuel Koczwara <[email protected]
> wrote:
> Hi,
>
> Dnia 2014-04-05, sob o godzinie 10:13 -0500, John M. Dlugosz pisze:
> > The sources I've learned about thus far are not helping me with this one.
> > What's "(# #)"?
> > Haskell is search-hostile.
> >
>
> Can you provide some context? It looks like ordinary string
>
> "(# #)" :: String
>
> or
>
> "(# #)" :: [Char]
>
> Emanuel
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140405/92795a98/attachment-0001.html>
------------------------------
Message: 6
Date: Sat, 05 Apr 2014 10:29:27 -0500
From: "John M. Dlugosz" <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] What does "(# #)" mean?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
The quotes are in my message, not part of the thing being quoted. E.g. 'What
does "+"
mean between two numbers?'
On 4/5/2014 10:20 AM, Emanuel Koczwara wrote:
> Hi,
>
> Dnia 2014-04-05, sob o godzinie 10:13 -0500, John M. Dlugosz pisze:
>> The sources I've learned about thus far are not helping me with this one.
>> What's "(# #)"?
>> Haskell is search-hostile.
>>
>
> Can you provide some context? It looks like ordinary string
>
> "(# #)" :: String
>
> or
>
> "(# #)" :: [Char]
>
> Emanuel
>
>
------------------------------
Message: 7
Date: Sat, 05 Apr 2014 10:32:42 -0500
From: "John M. Dlugosz" <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] iterated function value sequence
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed
On 4/4/2014 3:35 PM, Bob Ippolito wrote:
> There's a function named iterate in Prelude:
>
> ?> :info iterate
> iterate :: (a -> a) -> a -> [a] -- Defined in `GHC.List'
> ?> take 8 (iterate (\x -> 2 * x + 1) 0)
> [0,1,3,7,15,31,63,127]
>
Nice. I followed up with that to understand how it's written.
Now, how might I do something like that but "forget" previous values to free up
memory?
?John
------------------------------
Message: 8
Date: Sat, 5 Apr 2014 08:55:01 -0700
From: Bob Ippolito <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] iterated function value sequence
Message-ID:
<CACwMPm-MF5NH60zVWWeBr=8zip3rrbhh7wyaus6dyeb8wgb...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Saturday, April 5, 2014, John M. Dlugosz <[email protected]>
wrote:
> On 4/4/2014 3:35 PM, Bob Ippolito wrote:
>
>> There's a function named iterate in Prelude:
>>
>> ?> :info iterate
>> iterate :: (a -> a) -> a -> [a] -- Defined in `GHC.List'
>> ?> take 8 (iterate (\x -> 2 * x + 1) 0)
>> [0,1,3,7,15,31,63,127]
>>
>> Nice. I followed up with that to understand how it's written.
>
> Now, how might I do something like that but "forget" previous values to
> free up memory?
>
Garbage Collection does that for you. If all the references are gone, the
memory can be freed. If you have a specific use in mind I can show you what
that looks like.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140405/0079d6c3/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 70, Issue 10
*****************************************