Send Beginners mailing list submissions to beginners@haskell.org 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 beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@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: [Haskell-cafe] What is an "expected type" ... (michael rice) 2. Re: High precision doubles (Felipe Lessa) 3. Re: Rigid type variables match error (Felipe Lessa) 4. Re: High precision doubles (Matthew Eastman) 5. GHC compiling for different platforms (Bernhard Lehnert) 6. Re: GHC compiling for different platforms (Magnus Therning) ---------------------------------------------------------------------- Message: 1 Date: Sun, 28 Jun 2009 09:39:37 -0700 (PDT) From: michael rice <nowg...@yahoo.com> Subject: [Haskell-beginners] Re: [Haskell-cafe] What is an "expected type" ... To: "Brandon S. Allbery KF8NH" <allb...@ece.cmu.edu> Cc: beginners@haskell.org, Haskell Cafe mailing list <haskell-c...@haskell.org> Message-ID: <892836.55819...@web31108.mail.mud.yahoo.com> Content-Type: text/plain; charset="iso-8859-1" How else? ;-) Thanks, Michael --- On Sun, 6/28/09, Brandon S. Allbery KF8NH <allb...@ece.cmu.edu> wrote: From: Brandon S. Allbery KF8NH <allb...@ece.cmu.edu> Subject: Re: [Haskell-cafe] What is an "expected type" ... To: "michael rice" <nowg...@yahoo.com> Cc: "Brandon S. Allbery KF8NH" <allb...@ece.cmu.edu>, "Joe Fredette" <jfred...@gmail.com>, beginners@haskell.org, "Haskell Cafe mailing list" <haskell-c...@haskell.org> Date: Sunday, June 28, 2009, 12:06 PM On Jun 28, 2009, at 12:02 , michael rice wrote:dec2bin :: Integer -> [Integer] dec2bin n = dec2bin' n [] where dec2bin' n acc | n == 0 = acc | otherwise = let r = rem n 2 m = div (n - r) 2 in dec2bin' m (r : acc) is there any way to assign a type signature to the helper function? Same way you do for a top level binding: dec2bin :: Integer -> [Integer] dec2bin n = dec2bin' n [] where dec2bin' :: Integer -> [Integer] -> [Integer] dec2bin' n acc | n == 0 = acc | otherwise = let r = rem n 2 m = div (n - r) 2 in dec2bin' m (r : acc) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.comsystem administrator [openafs,heimdal,too many hats] allb...@ece.cmu.eduelectrical and computer engineering, carnegie mellon university KF8NH -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/beginners/attachments/20090628/f1f2fb7e/attachment-0001.html ------------------------------ Message: 2 Date: Sun, 28 Jun 2009 23:55:54 -0300 From: Felipe Lessa <felipe.le...@gmail.com> Subject: Re: [Haskell-beginners] High precision doubles To: beginners@haskell.org Message-ID: <20090629025554.ga22...@kira.casa> Content-Type: text/plain; charset=us-ascii On Sun, Jun 28, 2009 at 10:34:51PM -0400, Matthew Eastman wrote: > Just for fun, one of the mazes it made: > > ___ ___ ___ ___ ___ > ___/ \___/ \___/ \___/ \___/ \___ > / \ \ / / / \ \ > \ \___/ ___/ ___/ / \ / > / \___/ ___ \ \___/ \ / \ > \ / \___/ \ / \ / \___ \ / > / / ___/ \___/ ___ \___/ \ > \___/ / \___ \___/ \___ \ / > / \ / ___ ___/ \___/ \ > \___ \___/ \ \ / ___/ > / ___ \___/ \___/ \___/ \___ \ > \___/ \___/ \___/ \___/ \___/ \___/ This is beautiful! Do you plan releasing something to Hackage? -- Felipe. ------------------------------ Message: 3 Date: Mon, 29 Jun 2009 00:09:23 -0300 From: Felipe Lessa <felipe.le...@gmail.com> Subject: Re: [Haskell-beginners] Rigid type variables match error To: beginners@haskell.org Message-ID: <20090629030923.gb22...@kira.casa> Content-Type: text/plain; charset=us-ascii On Sat, Jun 27, 2009 at 10:18:02AM +0930, Darryn wrote: > class A a where > a1 :: a > a2 :: a -> a > a3 :: (B b) => b -> a It is clear here that 'b' is different from 'a' on 'a3's definition, right? Now let's rename 'b' to 'c' on your instance: > -- note that 'a = Ainst c' here. > instance (B c) => A (Ainst c) where > a1 :: Ainst c > a1 = I > a2 :: Ainst c -> Ainst c > a2 = J > a3 :: (B b) => b -> Ainst c > a3 = ... Oops! We have 'K :: (B b) => b -> Ainst b', but 'a3 :: (B b) => b -> Ainst c' is more general than that. Hope that helps, -- Felipe. ------------------------------ Message: 4 Date: Mon, 29 Jun 2009 11:03:25 -0400 From: Matthew Eastman <mg.east...@gmail.com> Subject: Re: [Haskell-beginners] High precision doubles To: beginners@haskell.org Message-ID: <e1424f75-ff53-4a9a-abd9-d45d2e079...@gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Sure, I can put it on Hackage. I'll have to figure out how to use Cabal, and tidy up the code, but I'll upload it sooner or later. On 28-Jun-09, at 10:55 PM, Felipe Lessa wrote: > On Sun, Jun 28, 2009 at 10:34:51PM -0400, Matthew Eastman wrote: >> Just for fun, one of the mazes it made: >> >> ___ ___ ___ ___ ___ >> ___/ \___/ \___/ \___/ \___/ \___ >> / \ \ / / / \ \ >> \ \___/ ___/ ___/ / \ / >> / \___/ ___ \ \___/ \ / \ >> \ / \___/ \ / \ / \___ \ / >> / / ___/ \___/ ___ \___/ \ >> \___/ / \___ \___/ \___ \ / >> / \ / ___ ___/ \___/ \ >> \___ \___/ \ \ / ___/ >> / ___ \___/ \___/ \___/ \___ \ >> \___/ \___/ \___/ \___/ \___/ \___/ > > This is beautiful! Do you plan releasing something to Hackage? > > -- > Felipe. > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners ------------------------------ Message: 5 Date: Mon, 29 Jun 2009 22:53:22 +0200 From: Bernhard Lehnert <b.lehn...@gmx.de> Subject: [Haskell-beginners] GHC compiling for different platforms To: beginners@haskell.org Message-ID: <1246308802.12903.16.ca...@sol> Content-Type: text/plain Hi folks! When I compile a program under windows - will the .exe run under any windows? Do I have to distribute only the .exe or more files? When I compile a program under a 64bit-Linux on an AMD-CPU, will the executable run under 32bit and/or Intel-CPU as well? Are there any, say, compiler flags, to improve portability? Thanks, Bernhard ------------------------------ Message: 6 Date: Mon, 29 Jun 2009 23:05:36 +0100 From: Magnus Therning <mag...@therning.org> Subject: Re: [Haskell-beginners] GHC compiling for different platforms To: beginners@haskell.org Message-ID: <4a493ab0.4000...@therning.org> Content-Type: text/plain; charset="utf-8" Bernhard Lehnert wrote: > Hi folks! > > When I compile a program under windows - will the .exe run under any > windows? Do I have to distribute only the .exe or more files? In my experience, yes. But I have really only taken .exe's compiled on XP to run on Vista and w2k3. > When I compile a program under a 64bit-Linux on an AMD-CPU, will the > executable run under 32bit and/or Intel-CPU as well? Are there any, say, > compiler flags, to improve portability? I don't think you'll have any success in running a 64-bit executable on a 32 bit system. However, I think most 64-bit systems are able to run 32-bit executables. I suspect GHC, with its static linking is a rather easier platform than C/C++ with its typically large set of shared objects. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnusï¼ therningï¼org Jabber: magnusï¼ therningï¼org http://therning.org/magnus identi.ca|twitter: magthe -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: OpenPGP digital signature Url : http://www.haskell.org/pipermail/beginners/attachments/20090629/5e3b88aa/signature.bin ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 12, Issue 16 *****************************************