Send Beginners mailing list submissions to
        [email protected]

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
        [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.  Haskell Platform SHA (sojourner)
   2. Re:  Haskell Platform SHA (Christopher Allen)
   3.  (.) vs ($) (Vale Cofer-Shabica)
   4. Re:  (.) vs ($) (Graham Gill)
   5. Re:  (.) vs ($) (Mike Meyer)


----------------------------------------------------------------------

Message: 1
Date: Fri, 3 Apr 2015 16:13:47 -0400
From: sojourner <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Haskell Platform SHA
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Downloaded Haskell Platform 2014.2.0.0.0 for Mac OSX from 
https://www.haskell.org/platform/mac.html. Twice. The SHA-256 on the web page 
is 62f39246ad95dd2aed6ece5138f6297f945d2b450f215d074820294310e0c48a. But 
running shasum or openssl on the downloaded file results in 
7c00f945fa7afb0f264bf253759f3dd02944a0ffef7b5f13317fa835ce841952.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150403/2af4eb39/attachment-0001.html>

------------------------------

Message: 2
Date: Fri, 3 Apr 2015 15:30: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] Haskell Platform SHA
Message-ID:
        <cadnndoptd8ia7zyuoo-kxroxd4gkfft2u8pfgkvfn9fwpaa...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Seems okay to me if I use sha256. I can't reproduce the hash you got with
any of the algorithms shasum offers.



[callen@atlantis ~/Downloads]$ sha256sum Haskell\ Platform\ 2014.2.0.0\
64bit.signed.pkg
62f39246ad95dd2aed6ece5138f6297f945d2b450f215d074820294310e0c48a  Haskell
Platform 2014.2.0.0 64bit.signed.pkg

[callen@atlantis ~/Downloads]$ sha1sum Haskell\ Platform\ 2014.2.0.0\
64bit.signed.pkg
5741fc1d9253568d3388fbe21c41d746acede9ab  Haskell Platform 2014.2.0.0
64bit.signed.pkg

[callen@atlantis ~/Downloads]$ sha224sum Haskell\ Platform\ 2014.2.0.0\
64bit.signed.pkg
6f5254d1ac958001eb93f1e30b4df0f34f372b791abd4bf66fd88c74  Haskell Platform
2014.2.0.0 64bit.signed.pkg

[callen@atlantis ~/Downloads]$ sha512sum Haskell\ Platform\ 2014.2.0.0\
64bit.signed.pkg
7f6a0e90966c3cc7f5000b4d2e92414a4959a22a6fed445547d9b01418bc4e4e3f391e3ec5f7713875753932a1b4880c57c30a3683885bb0209136080e6cb32c
 Haskell Platform 2014.2.0.0 64bit.signed.pkg

[callen@atlantis ~/Downloads]$ sha384sum Haskell\ Platform\ 2014.2.0.0\
64bit.signed.pkg
63fed8f9b8e8b51421462e0d12e45a8baa50e14640bc4f7ce8cbbfdc20f11cb8e0af5f1aee32c312f891569e95454ceb
 Haskell Platform 2014.2.0.0 64bit.signed.pkg

[callen@atlantis ~/Downloads]$ sha224sum Haskell\ Platform\ 2014.2.0.0\
64bit.signed.pkg
6f5254d1ac958001eb93f1e30b4df0f34f372b791abd4bf66fd88c74  Haskell Platform
2014.2.0.0 64bit.signed.pkg


On Fri, Apr 3, 2015 at 3:13 PM, sojourner <[email protected]> wrote:

> Downloaded Haskell Platform 2014.2.0.0.0 for Mac OSX from
> https://www.haskell.org/platform/mac.html. Twice. The SHA-256 on the web
> page is 62f39246ad95dd2aed6ece5138f6297f945d2b450f215d074820294310e0c48a.
> But running shasum or openssl on the downloaded file results
> in 7c00f945fa7afb0f264bf253759f3dd02944a0ffef7b5f13317fa835ce841952.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150403/94f4a216/attachment-0001.html>

------------------------------

Message: 3
Date: Fri, 3 Apr 2015 22:23:52 -0400
From: Vale Cofer-Shabica <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] (.) vs ($)
Message-ID:
        <CAAzfV4QG-trruDVfjOV2M7gH-9RGNSq=cpi4Jg_4ojjjXAR=3...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Could someone please explain why the commented line fails
spectacularly while the final line succeeds?

>import System.IO (getContents)
>import System.Environment (getArgs)

>fileInput :: IO String
>fileInput = getArgs>>=readFirst where
>  readFirst :: [FilePath] -> IO String
>  readFirst [] = System.IO.getContents
>--readFirst xs = readFile.head xs
>  readFirst xs = readFile $ head xs


I'm particularly confused given the following typings (from ghci):

readFile.head :: [FilePath] -> IO String
readFile.head [] :: a -> IO String

And this is still stranger:

:type readFile.head ["foo", "bar"]

<interactive>:28:16:
    Couldn't match expected type `a0 -> FilePath'
                with actual type `[Char]'
    In the expression: "foo"
    In the first argument of `head', namely `["foo", "bar"]'
    In the second argument of `(.)', namely `head ["foo", "bar"]'

<interactive>:28:23:
    Couldn't match expected type `a0 -> FilePath'
                with actual type `[Char]'
    In the expression: "bar"
    In the first argument of `head', namely `["foo", "bar"]'
    In the second argument of `(.)', namely `head ["foo", "bar"]'


Many thanks in advance,
vale


------------------------------

Message: 4
Date: Fri, 03 Apr 2015 22:34:37 -0400
From: Graham Gill <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] (.) vs ($)
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed

readFile.head xs = readFile . (head xs)

For that to work, (head xs) must evaluate to a function with which 
readFile can compose. But that wouldn't be the type you're wanting.

readFile $ head xs = readFile (head xs)

Graham

On 03/04/2015 10:23 PM, Vale Cofer-Shabica wrote:
> Could someone please explain why the commented line fails
> spectacularly while the final line succeeds?
>
>> import System.IO (getContents)
>> import System.Environment (getArgs)
>> fileInput :: IO String
>> fileInput = getArgs>>=readFirst where
>>   readFirst :: [FilePath] -> IO String
>>   readFirst [] = System.IO.getContents
>> --readFirst xs = readFile.head xs
>>   readFirst xs = readFile $ head xs
>
> I'm particularly confused given the following typings (from ghci):
>
> readFile.head :: [FilePath] -> IO String
> readFile.head [] :: a -> IO String
>
> And this is still stranger:
>
> :type readFile.head ["foo", "bar"]
>
> <interactive>:28:16:
>      Couldn't match expected type `a0 -> FilePath'
>                  with actual type `[Char]'
>      In the expression: "foo"
>      In the first argument of `head', namely `["foo", "bar"]'
>      In the second argument of `(.)', namely `head ["foo", "bar"]'
>
> <interactive>:28:23:
>      Couldn't match expected type `a0 -> FilePath'
>                  with actual type `[Char]'
>      In the expression: "bar"
>      In the first argument of `head', namely `["foo", "bar"]'
>      In the second argument of `(.)', namely `head ["foo", "bar"]'
>
>
> Many thanks in advance,
> vale
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners



------------------------------

Message: 5
Date: Fri, 3 Apr 2015 21:40:08 -0500
From: Mike Meyer <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>, Vale
        Cofer-Shabica <[email protected]>
Subject: Re: [Haskell-beginners] (.) vs ($)
Message-ID:
        <CAD=7U2D8wTs3+N=wtgpcetdy_scrkbmxzb08ko0w3rfafpa...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

As is often the case with Haskell, your answer is in the types:

Prelude> :t ($)
($) :: (a -> b) -> a -> b
Prelude> :t (.)
(.) :: (b -> c) -> (a -> b) -> a -> c

So $ takes a function and applies it to a value. . takes two functions and
composes them and applies the result to a value.

So readFirst xs = (readFile.head) xs, or just readFirst = readFile . head.
But readFirst xs = (readFile $ head) xs will also fail, because readFile
doesn't work on objects of type head.

On Fri, Apr 3, 2015 at 9:23 PM, Vale Cofer-Shabica <
[email protected]> wrote:

> Could someone please explain why the commented line fails
> spectacularly while the final line succeeds?
>
> >import System.IO (getContents)
> >import System.Environment (getArgs)
>
> >fileInput :: IO String
> >fileInput = getArgs>>=readFirst where
> >  readFirst :: [FilePath] -> IO String
> >  readFirst [] = System.IO.getContents
> >--readFirst xs = readFile.head xs
> >  readFirst xs = readFile $ head xs
>
>
> I'm particularly confused given the following typings (from ghci):
>
> readFile.head :: [FilePath] -> IO String
> readFile.head [] :: a -> IO String
>
> And this is still stranger:
>
> :type readFile.head ["foo", "bar"]
>
> <interactive>:28:16:
>     Couldn't match expected type `a0 -> FilePath'
>                 with actual type `[Char]'
>     In the expression: "foo"
>     In the first argument of `head', namely `["foo", "bar"]'
>     In the second argument of `(.)', namely `head ["foo", "bar"]'
>
> <interactive>:28:23:
>     Couldn't match expected type `a0 -> FilePath'
>                 with actual type `[Char]'
>     In the expression: "bar"
>     In the first argument of `head', namely `["foo", "bar"]'
>     In the second argument of `(.)', namely `head ["foo", "bar"]'
>
>
> Many thanks in advance,
> vale
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>


On Fri, Apr 3, 2015 at 9:23 PM, Vale Cofer-Shabica <
[email protected]> wrote:

> Could someone please explain why the commented line fails
> spectacularly while the final line succeeds?
>
> >import System.IO (getContents)
> >import System.Environment (getArgs)
>
> >fileInput :: IO String
> >fileInput = getArgs>>=readFirst where
> >  readFirst :: [FilePath] -> IO String
> >  readFirst [] = System.IO.getContents
> >--readFirst xs = readFile.head xs
> >  readFirst xs = readFile $ head xs
>
>
> I'm particularly confused given the following typings (from ghci):
>
> readFile.head :: [FilePath] -> IO String
> readFile.head [] :: a -> IO String
>
> And this is still stranger:
>
> :type readFile.head ["foo", "bar"]
>
> <interactive>:28:16:
>     Couldn't match expected type `a0 -> FilePath'
>                 with actual type `[Char]'
>     In the expression: "foo"
>     In the first argument of `head', namely `["foo", "bar"]'
>     In the second argument of `(.)', namely `head ["foo", "bar"]'
>
> <interactive>:28:23:
>     Couldn't match expected type `a0 -> FilePath'
>                 with actual type `[Char]'
>     In the expression: "bar"
>     In the first argument of `head', namely `["foo", "bar"]'
>     In the second argument of `(.)', namely `head ["foo", "bar"]'
>
>
> Many thanks in advance,
> vale
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150403/9b702a48/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 82, Issue 4
****************************************

Reply via email to