Re: [Haskell-cafe] [Haskell] macports, cabal, cabal-install difficulty
I don't know about the ld warning, but cabal-install can never know which version of cabal-install is installed, because it doesn't track executables - it only tracks and knows about libraries. Right after the warning is the line: > Installing executable(s) in /Users/matthew/.cabal/bin So it looks like it might have worked :-) You can either add ~/.cabal/bin to your path, or move/soft-link the cabal-install executable to your preferred path. Take care, Antoine On Sat, Dec 18, 2010 at 7:52 AM, Matthew Fairtlough wrote: > Hello, I'm new to this list and to hackage/cabal/cabal-install and haskell > on the mac generally. I don't dare post on cabal-devel because I'm a > newbie. > > I came to this question because I haven't been able to install the unix > package properly (some packages I want depend on it) but I've posted > separately in haskell-cafe on that. > I've port version 1.9.2 and haskell-platform @2009.2.0.2 (devel, haskell) > > My question: Is cabal currently out-of-the-box compatible with macports? I > seem to have problems with cabal-install, in particular the ld warning and > the fact that cabal doesn't seem to know what version of cabal-install is > installed. > > bash-3.2# cabal info cabal > * Cabal (library) > Synopsis: A framework for packaging Haskell software > Latest version available: 1.10.0.0 > Latest version installed: 1.10.0.0 > > bash-3.2# cabal install cabal-install-0.8.2 > Resolving dependencies... > Configuring cabal-install-0.8.2... > Preprocessing executables for cabal-install-0.8.2... > Building cabal-install-0.8.2... > ... > [40 of 40] Compiling Main ( Main.hs, > dist/build/cabal/cabal-tmp/Main.o ) > Linking dist/build/cabal/cabal ... > ld: warning: -read_only_relocs cannot be used with x86_64 > Installing executable(s) in /Users/matthew/.cabal/bin > > bash-3.2# cabal info cabal-install > * cabal-install (program) > Synopsis: The command-line interface for Cabal and Hackage. > Latest version available: 0.8.2 > Latest version installed: [ Unknown ] > > and lots more:... > > Homepage: http://www.haskell.org/cabal/ > Bug reports: http://hackage.haskell.org/trac/hackage/ > Description: The \'cabal\' command-line program simplifies the process > of > managing Haskell software by automating the fetching, > configuration, compilation and installation of Haskell > libraries and programs. > Category: Distribution > License: BSD3 > Author: Lemmih > Paolo Martini > Bjorn Bringert > Isaac Potoczny-Jones > Duncan Coutts > Maintainer: cabal-de...@haskell.org > Source repo: http://darcs.haskell.org/cabal-install/ > Executables: cabal > Flags: old-base, bytestring-in-base > Dependencies: unix >=1.0 && <2.5, Win32 ==2.*, bytestring >=0.9, > base <2.0 || >=3.0, base >=2.0 && <2.2, old-time >=1 && > <1.1, > array >=0.1 && <0.4, containers >=0.1 && <0.4, > random >=1 && <1.1, pretty >=1 && <1.1, > directory >=1 && <1.1, process >=1 && <1.1, base >=3, > base <3, time ==1.1.*, zlib >=0.4 && <0.6, > HTTP >=4000.0.2 && <4001, network >=1 && <3, filepath >>=1.0, > Cabal ==1.8.*, base >=2 && <5 > Cached: Yes > > > ___ > Haskell mailing list > hask...@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] DNS Problems at haskell.org
Just to clarify - I was the contact for Haskell.org but the email address was no longer being forwarded. I had assumed I had been removed as the contact but unfortunately only the technical contact had been changed. All was finally resolved with the help of Yale, where they resurrected the old email address, and Galois, who fixed things up once they had access to the account at Network Solutions. Everything is now in capable hands - sorry about the problems. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] (re)newcomer
Hello, It looks like you are using GHC 6.10, which is now a pretty old version of GHC. The latest version of the unix package on hackage requires a more recent version of GHC. You could try to force an older version of the unix library: cabal install happstack-server --constraints 'unix < 2.4' But you might be better off upgrading to a newer compiler. The easiest way would be to install the latest haskell platform for the mac which includes GHC 6.12.3, http://hackage.haskell.org/platform/mac.html Alternatively, you could install GHC 7, which is the latest stable version of the compiler. happstack-server from darcs compiles against GHC 7. In fact, if you are planning to start new development using happstack, I would recommend the darcs version as it is very closed to being released and the documentation reflects the darcs version of the code. More information on installing from darcs (which is easy) is here: http://happstack.com/download Hope this helps! If you have more questions I am happy to answer them! - jeremy p.s. The version of happstack-server on hackage was actually tested using GHC 6.10 and OS X, so it should be possible to get it working with out too much hacking if you really need GHC 6.10 for some reason. On Dec 18, 2010, at 2:40 AM, Matthew Fairtlough wrote: Hello Haskell-cafers, I used to teach Haskell (and Clean!) at University level but haven't touched Haskell in years and certainly never used it with a Mac. Now I work in publishing and want to experiment with Haskell's web services and see if I can help set up an open-source system for handling ONIX xml data. So I tried to install happstack-server (among several other things) and this depends on unix but cabal can't install unix. Error and diagnostics below as best as I could see to report them. Any tips/ pointers much appreciated; I'm not sure if this is a bug or where to report it if it is one... thanks for any help. Matthew. bash-3.2# cabal install unix Resolving dependencies... cabal: cannot configure unix-2.4.1.0. It requires base >=4.2 && <4.4 For the dependency on base >=4.2 && <4.4 there are these packages: base-4.2.0.0, base-4.2.0.1, base-4.2.0.2 and base-4.3.0.0. However none of them are available. base-4.2.0.0 was excluded because of the top level dependency base - any base-4.2.0.1 was excluded because of the top level dependency base - any base-4.2.0.2 was excluded because of the top level dependency base - any base-4.3.0.0 was excluded because of the top level dependency base - any bash-3.2# uname -a Darwin Matthew-Fairtloughs-MacBook-Pro.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/ RELEASE_I386 i386 bash-3.2# port version Version: 1.9.2 bash-3.2# port info haskell-platform haskell-platform @2009.2.0.2 (devel, haskell) Description: This is the the Haskell Platform: a single, standard Haskell distribution for every system. The Haskell Platform is a blessed library and tool suite for Haskell distilled from Hackage. Homepage: http://hackage.haskell.org/platform/ Runtime Dependencies: ghc, hs-platform-cgi, hs-platform-fgl, hs-platform-editline, hs-platform-GLUT, hs-platform-haskell-src, hs-platform-html, hs-platform-HUnit, hs-platform-mtl, hs-platform- network, hs-platform-OpenGL, hs-platform-parallel, hs-platform-parsec, hs-platform-QuickCheck, hs-platform-regex-base, hs-platform-regex-compat, hs-platform-regex-posix, hs-platform-stm, hs-platform-time, hs-platform-xhtml, hs- platform-zlib, hs-platform-HTTP, hs-platform-alex, hs-platform- happy, hs-platform-cabal Platforms:darwin License: unknown Maintainers: gwri...@macports.org bash-3.2# cabal -V cabal-install version 0.6.2 using version 1.6.0.3 of the Cabal library bash-3.2# cabal info base * base (library) Synopsis: Basic libraries Latest version available: 4.3.0.0 Latest version installed: 4.1.0.0 Homepage: [ Not specified ] Bug reports: http://hackage.haskell.org/trac/ghc/newticket?component=libraries/base Description: This package contains the Prelude and its support libraries, and a large collection of useful libraries ranging from data structures to parsing combinators and debugging utilities. License: BSD3 Maintainer:librar...@haskell.org Source repo: http://darcs.haskell.org/packages/base/ Flags: integer-simple Dependencies: rts -any, ghc-prim -any, integer-simple -any, integer-gmp -any Documentation: /opt/local/share/ghc-6.10.4/doc/ghc/libraries/base Cached:
[Haskell-cafe] (re)newcomer
Hello Haskell-cafers, I used to teach Haskell (and Clean!) at University level but haven't touched Haskell in years and certainly never used it with a Mac. Now I work in publishing and want to experiment with Haskell's web services and see if I can help set up an open-source system for handling ONIX xml data. So I tried to install happstack-server (among several other things) and this depends on unix but cabal can't install unix. Error and diagnostics below as best as I could see to report them. Any tips/pointers much appreciated; I'm not sure if this is a bug or where to report it if it is one... thanks for any help. Matthew. bash-3.2# cabal install unix Resolving dependencies... cabal: cannot configure unix-2.4.1.0. It requires base >=4.2 && <4.4 For the dependency on base >=4.2 && <4.4 there are these packages: base-4.2.0.0, base-4.2.0.1, base-4.2.0.2 and base-4.3.0.0. However none of them are available. base-4.2.0.0 was excluded because of the top level dependency base -any base-4.2.0.1 was excluded because of the top level dependency base -any base-4.2.0.2 was excluded because of the top level dependency base -any base-4.3.0.0 was excluded because of the top level dependency base -any bash-3.2# uname -a Darwin Matthew-Fairtloughs-MacBook-Pro.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386 bash-3.2# port version Version: 1.9.2 bash-3.2# port info haskell-platform haskell-platform @2009.2.0.2 (devel, haskell) Description: This is the the Haskell Platform: a single, standard Haskell distribution for every system. The Haskell Platform is a blessed library and tool suite for Haskell distilled from Hackage. Homepage: http://hackage.haskell.org/platform/ Runtime Dependencies: ghc, hs-platform-cgi, hs-platform-fgl, hs-platform-editline, hs-platform-GLUT, hs-platform-haskell-src, hs-platform-html, hs-platform-HUnit, hs-platform-mtl, hs-platform-network, hs-platform-OpenGL, hs-platform-parallel, hs-platform-parsec, hs-platform-QuickCheck, hs-platform-regex-base, hs-platform-regex-compat, hs-platform-regex-posix, hs-platform-stm, hs-platform-time, hs-platform-xhtml, hs-platform-zlib, hs-platform-HTTP, hs-platform-alex, hs-platform-happy, hs-platform-cabal Platforms:darwin License: unknown Maintainers: gwri...@macports.org bash-3.2# cabal -V cabal-install version 0.6.2 using version 1.6.0.3 of the Cabal library bash-3.2# cabal info base * base (library) Synopsis: Basic libraries Latest version available: 4.3.0.0 Latest version installed: 4.1.0.0 Homepage: [ Not specified ] Bug reports: http://hackage.haskell.org/trac/ghc/newticket?component=libraries/base Description: This package contains the Prelude and its support libraries, and a large collection of useful libraries ranging from data structures to parsing combinators and debugging utilities. License: BSD3 Maintainer:librar...@haskell.org Source repo: http://darcs.haskell.org/packages/base/ Flags: integer-simple Dependencies: rts -any, ghc-prim -any, integer-simple -any, integer-gmp -any Documentation: /opt/local/share/ghc-6.10.4/doc/ghc/libraries/base Cached:No Modules: ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: genprog-0.1
(Moved from hask...@haskell.org) Hi Kenneth, I'm sorry for the very late reply. On Wed, 2010-12-08 at 10:01 +0100, Kenneth Hoste wrote: > Hi Jan, > > On 11/29/2010 12:55 PM, Jan Snajder wrote: > > Dear Haskellers, > > > > I am pleased to announce the release of genprog-0.1, a genetic > > programming library. > > > > (snip) > > Very interesting, and nice job on the code (elegant, well-structured, > well-documented, ...)! Thank you. This was my first shot at building a Haskell library and I'm flattered to receive such positive comments :-) > Genetic programming recently got my attention because one of the bots in > the Google AI contest was built using this technique (see > http://ai-contest.com/forums/viewtopic.php?f=17&t=1136), and it > performed really well (way better than my hand-crafted bot). Interesting, thanks for the link. > I have a bit of experience with genetic algorithms, on a practical and > pragmatic level. The field of genetic programming is something I hope to > look at and play with in the upcoming months (just for fun). > > I was kind of planning to implement my own genetic programming library > in Haskell as I became familiar with the field, but after diving into > your code it quickly became clear to me you've done a way better job > than I would have. > > I really like the example you provided for evolving an expression that > computes a specified integer value. I kept this example deliberatly simple so to make it clear how you can use the library. The example is actually a degenerated case of symbolic regression, in which you are given only a single instance to train at, rather than a set of instances. You can find much more interesting examples in Koza's book. > I plan to start playing with that > and improve the example (faster convergence to a perfect solution, and > also tweaking the current GP config to obtain smaller solutions). > > > A couple of questions (some fairly unrelated to Haskell): > > How hard would it be to extend the current version to support the > evolution of actual Haskell programs? As far as I can tell, the current > version has support for (simple?) self-defined expressions, but this > seems like a long way from supporting Haskell programs with > multi-argument functions that operate on lists, etc., even if you just > limit it to non-monadic Haskell98 code. Actually, I have no idea. :-) I don't know if there is a data structure that can represent an AST of a Haskell program. I guess there is, because I guess at some point a compiler like GHC has to maintain such a structure internally, but I never looked into this. At present, I am more than satisfied to be able to evolve custom-made data structures. Another issue with evolving arbitrary Haskell (or whatever) programs is the "closure property". When doing crossover, you have to ensure that what you get by exchanging two subtrees still is a valid program. In other words, if F is a set of (arbitrary arity) functional nodes and T is a set of terminal nodes, then, given a functional node F(x1,...,xi,...xn), you should be able to substitute for argument xi each element of F `union` T. Obviouslly, this will not work for programms in general and you would have to either introduce specialized crossover operations or treat the nodes differently depending on their types. In genprog, I have kept things simple and closure propery is ensured by allowing crossover to take place only at nodes that are of the same type as the root node. This is certainly a limitation, but still I think one can do interesting stuff with it. > > Have you considered playing with dynamic values for the various > parameters that steer the evolution, i.e. population size, > crossover/mutation probabilities, etc.? > One thing I've always wanted to try (but never really got to it) is e.g. > increasing the mutation probability as the evolution seems to be getting > stuck in a (local?) optimum. Also, shrinking the population size if > enough progress is being made could be interesting, to speed up the > evolutionary process. Are you aware of studies that do such a thing? Yes, definitely! Variable mutation probability is often used in genetic algorithms to improve the results. The idea is to have higher mutation probability in the beginning, so to encourage exploration, and then decrease the mutation probability as the evolution progresses, so to encourage exploitation. This increases the chances of not getting stuck in a local optima. But I didn't include this into genprog because I don't need variable mutation right now. I will probably do it in the next release. The most straightforward to do it, I guess, would be make the mutation prob. (and pop. size) a function of the evolution state. There are also other things that I plan to include in the next release. I hope I will find time to do it. Btw., mutation is actually rarely used in GP (unlike in GA). Koza, for example, used mutation in one example only. The thing is that, if
Re: [Haskell-cafe] Why is Haskell flagging this?
No problem. Haskell is a different animal than even other functional languages in my experience, and it takes time to get used to the coolness in the type system, the lazy evaluation, the point free style, functional composition and all the other interesting techniques you now have at your fingertips for writing very expressive code :-). Do that for a while then go back to algol based languages, and wonder why the heck anyone uses those on purpose :-). (yeah there's good reasons to use them, but it starts to feel confining) Dave On Fri, Dec 17, 2010 at 4:28 PM, michael rice wrote: > Hi, all. > > Plenty of answers. Thank you. > > Putting the list in the IO monad was deliberate. Another one I was looking > at was > > f :: String -> IO String > f s = do return s > > main = do ios <- f "hello" > fmap tail ios > > which worked fine > > So, the big error was trying to add 1 + [1,2,3,4,5]. > > I considered that I needed an additional fmap and thought I had tried > > fmap (fmap (1+)) iol > > but must have messed it up, because I got an error. I guess I was on the > right track. > > I like to try various combinations to test my understanding. It's kind of > embarrassing when I get stumped by something simple like this, but that's > how one learns. > > Thanks again, > > Michael > > --- On Fri, 12/17/10, Daniel Fischer > wrote: > > > From: Daniel Fischer > Subject: Re: [Haskell-cafe] Why is Haskell flagging this? > To: haskell-cafe@haskell.org > Cc: "michael rice" > Date: Friday, December 17, 2010, 4:24 PM > > > On Friday 17 December 2010 18:04:20, michael rice wrote: > > I don't understand this error message. Haskell appears not to > understand > > that 1 is a Num. > > > > Prelude> :t 1 > > 1 :: (Num t) => t > > Prelude> :t [1,2,3,4,5] > > [1,2,3,4,5] :: (Num t) => [t] > > Prelude> > > > > Michael > > > > === > > > > f :: [Int] -> IO [Int] > > f lst = do return lst > > > > main = do let lst = f [1,2,3,4,5] > > fmap (+1) lst > > The fmap is relative to IO, your code is equivalent to > > do let lst = (return [1,2,3,4,5]) >fmap (+1) lst > > ~> > > fmap (+1) (return [1,2,3,4,5]) > > ~> > > do lst <- return [1,2,3,4,5] >return $ (+1) lst > > but there's no instance Num [Int] in scope > > You probably meant > > > do let lst = f [1,2,3,4,5] >fmap (map (+1)) lst > > > > > > === > > > > Prelude> :l test > > [1 of 1] Compiling Main ( test.hs, interpreted ) > > > > test.hs:5:17: > > No instance for (Num [Int]) > > arising from the literal `1' at test.hs:5:17 > > Possible fix: add an instance declaration for (Num [Int]) > > In the second argument of `(+)', namely `1' > > In the first argument of `fmap', namely `(+ 1)' > > In the expression: fmap (+ 1) lst > > Failed, modules loaded: none. > > Prelude> > > > --- On *Fri, 12/17/10, Daniel Fischer > *wrote: > > > From: Daniel Fischer > Subject: Re: [Haskell-cafe] Why is Haskell flagging this? > To: haskell-cafe@haskell.org > Cc: "michael rice" > Date: Friday, December 17, 2010, 4:24 PM > > On Friday 17 December 2010 18:04:20, michael rice wrote: > > I don't understand this error message. Haskell appears not to understand > > that 1 is a Num. > > > > Prelude> :t 1 > > 1 :: (Num t) => t > > Prelude> :t [1,2,3,4,5] > > [1,2,3,4,5] :: (Num t) => [t] > > Prelude> > > > > Michael > > > > === > > > > f :: [Int] -> IO [Int] > > f lst = do return lst > > > > main = do let lst = f [1,2,3,4,5] > > fmap (+1) lst > > The fmap is relative to IO, your code is equivalent to > > do let lst = (return [1,2,3,4,5]) >fmap (+1) lst > > ~> > > fmap (+1) (return [1,2,3,4,5]) > > ~> > > do lst <- return [1,2,3,4,5] >return $ (+1) lst > > but there's no instance Num [Int] in scope > > You probably meant > > > do let lst = f [1,2,3,4,5] >fmap (map (+1)) lst > > > > > > === > > > > Prelude> :l test > > [1 of 1] Compiling Main ( test.hs, interpreted ) > > > > test.hs:5:17: > > No instance for (Num [Int]) > > arising from the literal `1' at test.hs:5:17 > > Possible fix: add an instance declaration for (Num [Int]) > > In the second argument of `(+)', namely `1' > > In the first argument of `fmap', namely `(+ 1)' > > In the expression: fmap (+ 1) lst > > Failed, modules loaded: none. > > Prelude> > > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell, Step by Step, Tutorial, Developing a Whole Application
I agree with the feeling that Haskell tutorials feel like they are bottom-up. But I think there's a reason for this: In my experience, at least, Haskell applications are built bottom-up. Functional programming languages strive for composability. In Haskell you have very clean, clear ways of composing functions, Monads, and even composing them with each other. In OOP languages, the glue that you have for composing objects is more objects. This can be a much less elegant way to build applications bottom-up, and so bottom up applications feel sloppy and hacked together. In an OOP app, you need to start with some kind of scaffolding, such as mvc or the like, so that as you compose your objects, they start to take the shape of a well-structured application. In functional programming, that composability is much more flexible, so you don't need to worry as much about coding yourself into a poorly structured app. After all, mvc is all about separation of concerns which comes naturally if you keep as much as possible outside of the IO monad. When I'm coding in Haskell, I like to think in the paradigm of creating a domain specific language. I'm not writing my program for the first 90% of development, I'm actually working on the DSL that will be used to create my app. Finally, i switch from functional programming to imperative, procedural programming in the IO monad (or some custom Monad) to write the actual code. The end result is a flexible, maintainable program in very few lines of code and then some very general, reusable library code supporting it. I didn't address the actual question, instead I tried to speak to how I got around the problem. Hope my $0.02 helps. --Jonathan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [URGENT] DNS problems at haskell.org?
I bet they did try to contact the owner. But when the contact email no longer works nobody will get the messages. On Sat, Dec 18, 2010 at 3:35 PM, Ketil Malde wrote: > Karel Gardas writes: > > > > http://www.reddit.com/r/haskell/comments/encrv/whats_happened_to_haskellorg_did_someone_forget/c19guw1 > > Quoth dons: > > | The domain name was seized by Network Solutions (it wasn't due to > | expire until this time next year). The confusion seems to be that > | while Yale was the nominated owner, it was administered by Galois. > > | We've contacted Network Solutions and resolve their confusion. > > Would it be impertinent to question the wisdom of using a domain > provider that just breaks a paid-for and working site without contacting > the owner? How about contacting another, more professional registrar > instead of Network Solution? > > http://www.host-shopper.com/web-hosts-reviews.html?sortBy=rating > > -k > -- > If I haven't seen further, it is by standing in the footprints of giants > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] unable to load package `regex-posix-0.94.2' (On Vista x64)
I am using Vista x64. I have Haskell platform installed (Latest varsion -available for Windows, 2010.2.0.0, GHC 6.12.3). When I am trying to run picnic.hs from "How To Organize a Picnic on a Computer" tutorial. I get this: C:\...>runhaskell picnic.hs picnic.hs:46:18: Warning: accepting non-standard pattern guards (use - XPatternGuards to suppr ess this message) Just [x, y] <- matchRegex (mkRegex "([0-9.]+), ([0-9.]+)") s picnic.hs:181:21: Warning: accepting non-standard pattern guards (use - XPatternGuards to suppr ess this message) Just (_, e) <- find ((== p) . fst) a picnic.hs: C:\Program Files (x86)\Haskell Platform\2010.2.0.0\lib \extralibs\rege x-posix-0.94.2\ghc-6.12.3\HSregex-posix-0.94.2.o: unknown symbol `_regerror' picnic.hs: picnic.hs: unable to load package `regex-posix-0.94.2' I have tried to update using (cmd is running as administrator): C:\Windows\system32>cabal update Downloading the latest package list from hackage.haskell.org And then installing package using cabal: C:\Windows\system32>cabal install regex-posix [--reinstall] --global Resolving dependencies... Configuring regex-posix-0.94.4... Preprocessing library regex-posix-0.94.4... Building regex-posix-0.94.4... [1 of 6] Compiling Text.Regex.Posix.Wrap ( dist\build\Text\Regex\Posix \Wrap.hs, dist\build\Text\Regex\Posix\Wrap.o ) [2 of 6] Compiling Text.Regex.Posix.String ( Text\Regex\Posix \String.hs, dist\bu ild\Text\Regex\Posix\String.o ) [3 of 6] Compiling Text.Regex.Posix.Sequence ( Text\Regex\Posix \Sequence.hs, dis t\build\Text\Regex\Posix\Sequence.o ) [4 of 6] Compiling Text.Regex.Posix.ByteString ( Text\Regex\Posix \ByteString.hs, dist\build\Text\Regex\Posix\ByteString.o ) [5 of 6] Compiling Text.Regex.Posix.ByteString.Lazy ( Text\Regex\Posix \ByteStrin g\Lazy.hs, dist\build\Text\Regex\Posix\ByteString\Lazy.o ) [6 of 6] Compiling Text.Regex.Posix ( Text\Regex\Posix.hs, dist\build \Text\Regex \Posix.o ) Registering regex-posix-0.94.4... Installing library in C:\Program Files (x86)\Haskell\regex-posix-0.94.4\ghc-6.12.3 Registering regex-posix-0.94.4... And why the cabal package installs at "C:\Program Files (x86)\Haskell"? Shouldn't it be "C:\Program Files (x86)\Haskell Platform\2010.2.0.0"? Thanks ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why is Haskell flagging this?
On 17 Dec 2010, at 21:44, Christopher Done wrote: > On 17 December 2010 18:04, michael rice wrote: > === > > f :: [Int] -> IO [Int] > f lst = do return lst > > main = do let lst = f [1,2,3,4,5] > fmap (+1) lst > > The problem is that you are applying fmap to a type IO a. > > fmap (+1) (return [1,2,3]) > > But to achieve the behaviour you expect, you need another fmap: > > fmap (fmap (+1)) (return [1,2,3]) Which can be more neatly written with Conal's semantic editor cominators as (fmap . fmap) (+1) (return [1,2,3]) Of course, I question why the list is put in the IO monad at all here... surely this would be much better return $ fmap (+1) [1,2,3] Finally, that has the wrong type for main... perhaps you meant to print it out? main :: IO () main = print $ fmap (+1) [1,2,3] Bob___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why is Haskell flagging this?
On 17 December 2010 18:04, michael rice wrote: > === > > f :: [Int] -> IO [Int] > f lst = do return lst > > main = do let lst = f [1,2,3,4,5] > fmap (+1) lst The problem is that you are applying fmap to a type IO a. fmap (+1) (return [1,2,3]) But to achieve the behaviour you expect, you need another fmap: fmap (fmap (+1)) (return [1,2,3]) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why is Haskell flagging this?
Write out more types and it'll get more clear. f is [Int] -> IO [Int] lst is f applied to Num a => [a], so it is of type IO [Int] fmap is applied to lst, which means it's "stepping inside" the IO. That means it's applying +1 to [1,2,3,4,5], which doesn't make much sense unless you have a Num instance for [Int]. That's what the error was saying. What you probably want is fmap (fmap (+1)) lst. Not sure why you're doing this stuff in the first place though, since the return into IO is only restricting what you can do with it. Also, the do in both cases is unnecessary (in the second case you can replace the let with a let..in) Hope this helps, Dan On Fri, Dec 17, 2010 at 12:04 PM, michael rice wrote: > I don't understand this error message. Haskell appears not to understand > that 1 is a Num. > > Prelude> :t 1 > 1 :: (Num t) => t > Prelude> :t [1,2,3,4,5] > [1,2,3,4,5] :: (Num t) => [t] > Prelude> > > Michael > > === > > f :: [Int] -> IO [Int] > f lst = do return lst > > main = do let lst = f [1,2,3,4,5] > fmap (+1) lst > > === > > Prelude> :l test > [1 of 1] Compiling Main ( test.hs, interpreted ) > > test.hs:5:17: > No instance for (Num [Int]) > arising from the literal `1' at test.hs:5:17 > Possible fix: add an instance declaration for (Num [Int]) > In the second argument of `(+)', namely `1' > In the first argument of `fmap', namely `(+ 1)' > In the expression: fmap (+ 1) lst > Failed, modules loaded: none. > Prelude> > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Making type-incompatible strategies interchangeable
Excerpts from Jacek Generowicz's message of Fri Dec 17 20:17:30 -0500 2010: > Imagine an activity which may be performed either by a computer, or > by a human (alternatively, either locally, or remotely across a > network). From Haskell's type system's perspective, these two will > look completely different (most obviously, the human (or the > network) is wrapped in IO). How can they be made interchangeable ? This particular example can be resolved from lifting the pure, computer computation into IO. One way of abstracting this interaction is to use the Prompt monad. [1] This doesn't work in general, and indeed types do have the unfortunate property of reducing modularity. This is especially evident when you work with dat structures that have their invariants encoded in the type system. [2] Or maybe this is a good thing, since you don't want IO leaking into your test suite without you knowing about it... [1] http://web.mit.edu/~ezyang/Public/threemonads.pdf [2] http://www.cis.upenn.edu/~bcpierce/papers/harmful-mfps.pdf ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Infinite lists in real world programs
Thanks you all for your links, I will read this. However, Brent, I fail to understand your implementation of Monad... I understand the purpose, but not the algorithm. 2010/12/18 Matthew Sottile > Hi- > > This may be of some interest: > > https://github.com/mjsottile/hsworkflow/raw/master/docs/works09paper.pdf > > That describes a simple project that I think is similar to what you are > looking at doing. The code is in that github repository as well, a couple > directories up from the paper. > > https://github.com/mjsottile/hsworkflow/ > > -m > > > On Dec 15, 2010, at 5:52 AM, Yves Parès wrote: > > > Hello Café, > > > > I was wondering if using infinite lists was a viable and efficient > solution in haskell programs (I mean not simple prototypes) : > > I was considering using them to model agents in a hierarchical > multi-agent application for school. > > A list would representate the state of an agent at a step of the program. > > > > Let's say we have two simple agents, one multiplying its input by 2 and > the other dividing it by 4 : > > > > > > agent1 = fmap (*2) > > agent2 = fmap (/4) > > > > allValues = xs where > > ys = agent1 xs > > xs = 100:agen2 ys > > > > main = do > >mapM_ print $ take 100 allValues > > > > > > Of course, in a real program, an agent would rather take a list of > multiple agents (i.e. a list of lists) in input, so that its ouput could > depend on what several agents feed him. > > > > Some could state what I'm trying to do is FRP, and I agree. But it > remains a simple goal so I'd like to keep the program simple, and not go > into the whole complexity of a FRP framework (and I'm working with a > non-haskeller). > > For instance, with my solution, I cannot dynamically connect or > disconnect agents during the runtime, but I'll will not need to do that in > my program. > > Besides, I'd like to try to implement this myself, not use an already > existing framework. > > > > So is it viable or would the use of multiple infinite lists kill the > performances? > > ___ > > Haskell-Cafe mailing list > > Haskell-Cafe@haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] DNS problems at haskell.org?
The whois still says it is registered to Galois, Inc. Then, hopefully, it is just a DNS problem. Guys, if you that are responsible for managing haskell.org need a hand with sysadmin tasks I volunteer to work. I don't have lots of spare time, but I do have some. Just let me know. Thanks, On Fri, Dec 17, 2010 at 12:01 PM, Eugene Kirpichov wrote: > Hello. > > For a couple of friends of mine, hackage.haskell.org happens to > resolve to something strange (parked domain), though haskell.org works > ok. This might be something to tell to haskell.org admins. > > Find below an example tracert (messages in Russian have been translated). > > C:\Program Files (x86)\Far2>tracert hackage.haskell.org > > Tracing to hackage.haskell.org [209.62.105.19], max hops = 30 > > 1 8 ms 4 ms 4 ms bsr01.nn.ertelecom.ru [91.144.184.69] > 2 **2 ms net184-77.nn.ertelecom.ru [91.144.184.77] > 313 ms 9 ms 9 ms > NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] > 4 9 ms29 ms 9 ms 83.229.226.101 > 510 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net > [195.34.38.37] > 6 142 ms 142 ms 142 ms ss-crs-1-be3.msk.stream-internet.net > [195.34.53.86] > 7 142 ms 142 ms 142 ms mar-crs-1-be6.msk.stream-internet.net > [195.34.59.141] > 8 143 ms 142 ms 142 ms oct-crs-1-be1.spb.stream-internet.net > [195.34.53.194] > 9 143 ms 142 ms 142 ms bro-cr01-be3.stk.stream-internet.net > [212.188.1.194] > 1066 ms66 ms66 ms tct-cr01-te5-1.ams.stream-internet.net > [195.34.53.14] > 11 142 ms 307 ms 207 ms sd-cr01-te2-1.nyc.stream-internet.net > [195.34.59.114] > 12 *** Request timed out > 13 179 ms 179 ms 179 ms e8-2.ibr03.dllstx3.networklayer.com > [70.87.253.189] > 14 190 ms 189 ms 190 ms e1-1.ibr01.hstntx2.networklayer.com > [70.87.253.50] > 15 190 ms 190 ms 190 ms te2-2.dsr02.hstntx2.networklayer.com > [74.55.252.38] > 16 184 ms 185 ms 184 ms po2.car3.hstntx2.networklayer.com > [74.55.252.106] > 17 189 ms 189 ms 189 ms > ev1s-209-62-105-19.theplanet.com[209.62.105.19] > > Trace finished > > C:\Program Files (x86)\Far2>tracert haskell.org > > Tracing to haskell.org [78.46.100.180], max hops = 30 > > 1 4 ms 3 ms 2 ms bsr01.nn.ertelecom.ru [91.144.184.69] > 2 *2 ms 2 ms net184-77.nn.ertelecom.ru [91.144.184.77] > 310 ms 9 ms 9 ms > NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] > 4 9 ms 9 ms11 ms 83.229.226.101 > 510 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net > [195.34.38.37] > 655 ms55 ms55 ms ss-crs-1-be3.msk.stream-internet.net > [195.34.53.86] > 753 ms52 ms52 ms m9-crs-1-be9.msk.stream-internet.net > [195.34.59.250] > 855 ms55 ms55 ms bor-crs-1-be1.spb.stream-internet.net > [195.34.53.126] > 952 ms52 ms52 ms anc-cr01-po3.ff.stream-internet.net > [195.34.53.102] > 1052 ms52 ms52 ms anc-cr02-po1.ff.stream-internet.net > [212.188.0.122] > 1156 ms56 ms56 ms decix2-gw.hetzner.de [80.81.193.164] > 1260 ms60 ms60 ms > hos-bb1.juniper1.fs.hetzner.de[213.239.240.242] > 1364 ms61 ms63 ms > hos-tr1.ex3k10.rz12.hetzner.de[213.239.228.139] > 1460 ms60 ms62 ms lambda.haskell.org [78.46.100.180] > > Trace finished > > > -- > Eugene Kirpichov > Senior Software Engineer, > Grid Dynamics http://www.griddynamics.com/ > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- ~dsouza yahoo!im: paravinicius gpg key fingerprint: 71B8 CE21 3A6E F894 5B1B 9ECE F88E 067F E891 651E gpg pub key: http://bitforest.org/~dsouza/pub/gpg-pubkey.txt authorized_keys: http://bitforest.org/~dsouza/pub/authorized_keys.txt ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] handling multiple versions of a data structure
No, I don't think so. It uses some extensions, but happstack-data already does, so that shouldn't be a problem. We don't have a releasable library yet, but when we do, it will have a versioned binary implementation, just like happstack-data does now. Perhaps even binary compatible with it, though I'm not sure about that. Erik On Sat, Dec 18, 2010 at 19:11, Jeremy Shaw wrote: > Nice. > > Do you think there is any reason we would not be able to / want to use it > with happstack ? I would love happstack-data to 'go away' and just use some > library from hackage which does the same thing. > > - jeremy > > On Dec 17, 2010, at 3:57 AM, Erik Hesselink wrote: > >> I've recently been playing with code for versioning data types. It's >> based on happstacks implementation, but uses type families to make it >> more modular. I've got some proof of concept code on github [1]. We're >> also writing a small library based on this at typLAB, which we'll >> probably release as well. >> >> Erik >> >> [1] https://gist.github.com/704109 >> >> On Thu, Dec 16, 2010 at 19:26, Dmitry V'yal wrote: >>> >>> Greetings, >>> >>> while developing my neural net simulator I stumbled upon a problem. >>> >>> I have a data type NeuralNet and use Show and Read instances for saving >>> and >>> loading configurations. As time passed, I changed the data type, so the >>> program can no longer load files saved in previous versions. >>> >>> I want fix it. My current idea looks as follows. I'm going to create a >>> bunch >>> of types NN1, NN2, NN3..NNn for different versions and write converters >>> c12 >>> :: N1 -> N2, c23 :: N2 -> N3 and so on. >>> >>> But how to organize the whole process of parsing String into NNn so it's >>> easy to change formats? >>> Something based on using a list of parsers >>> [read, c43 . read, c43 . c23 . read, c43, c23 . c12 . read, c43 . c32 . >>> c21 >>> . read] >>> >>> looks rather verbose and grows quadratically with N. >>> >>> I'm sure there must be a more elegant way. Any ideas? >>> >>> Dmitry >>> >>> ___ >>> Haskell-Cafe mailing list >>> Haskell-Cafe@haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> >> ___ >> Haskell-Cafe mailing list >> Haskell-Cafe@haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] handling multiple versions of a data structure
Nice. Do you think there is any reason we would not be able to / want to use it with happstack ? I would love happstack-data to 'go away' and just use some library from hackage which does the same thing. - jeremy On Dec 17, 2010, at 3:57 AM, Erik Hesselink wrote: I've recently been playing with code for versioning data types. It's based on happstacks implementation, but uses type families to make it more modular. I've got some proof of concept code on github [1]. We're also writing a small library based on this at typLAB, which we'll probably release as well. Erik [1] https://gist.github.com/704109 On Thu, Dec 16, 2010 at 19:26, Dmitry V'yal wrote: Greetings, while developing my neural net simulator I stumbled upon a problem. I have a data type NeuralNet and use Show and Read instances for saving and loading configurations. As time passed, I changed the data type, so the program can no longer load files saved in previous versions. I want fix it. My current idea looks as follows. I'm going to create a bunch of types NN1, NN2, NN3..NNn for different versions and write converters c12 :: N1 -> N2, c23 :: N2 -> N3 and so on. But how to organize the whole process of parsing String into NNn so it's easy to change formats? Something based on using a list of parsers [read, c43 . read, c43 . c23 . read, c43, c23 . c12 . read, c43 . c32 . c21 . read] looks rather verbose and grows quadratically with N. I'm sure there must be a more elegant way. Any ideas? Dmitry ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Making type-incompatible strategies interchangeable
Warning! Incredibly hacky Haskell coming up! Here's some code that seems to do the near same thing as your Python. Below it is some sample output. A couple of differences are that the secret number should be between 1 and 10, and whenever the computer tries guess it just picks a random number until it get it right. Additionally the code maintains a record of wrong guesses in a list as opposed to an incrementing count. -deech {-# LANGUAGE ScopedTypeVariables, EmptyDataDecls, PackageImports #-} import Control.Monad.Random import "mtl" Control.Monad.State import "mtl" Control.Monad.Writer human_asker :: IO Int human_asker = do putStrLn "What's the secret number?" getLine >>= return . read randomNum :: Int -> Int -> IO Int randomNum low high = getStdRandom $ randomR (low, high) computer_asker :: IO Int computer_asker = randomNum 1 10 computer_guesser :: StateT Int (WriterT [Int] IO) () computer_guesser = do guess::Int <- liftIO $ randomNum 1 10 secret <- get process guess secret where process g s | g < s = do {tell [g]; liftIO $ putStrLn "Too low"; computer_guesser} | g > s = do {tell [g]; liftIO $ putStrLn "Too high"; computer_guesser} | g == s = do {liftIO $ putStrLn "Got it!"} human_guesser :: StateT Int (WriterT [Int] IO) () human_guesser = do guess::Int <- liftIO $ do {putStrLn "What's your guess?"; getLine >>= return . read;} secret <- get process guess secret where process g s | g < s = do {tell [g]; liftIO $ putStrLn "Too low"; human_guesser} | g > s = do {tell [g]; liftIO $ putStrLn "Too high"; human_guesser} | g == s = do {liftIO $ putStrLn "Got it!"} play asker guesser = asker >>= runWriterT . execStateT guesser -- # Output From Sample Runs > play human_asker computer_guesser What's the secret number? 10 Too low Too low Too low Too low Too low Too low Too low Too low Too low Too low Too low Too low Too low Too low Too low Too low Got it! (10,[3,8,7,7,1,5,8,6,4,7,1,8,5,7,2,3]) *Main> play computer_asker computer_guesser Too high Too high Too high Too high Too high Too high Too high Too high Too high Too high Too high Too high Too high Too high Too high Too high Too high Too high Too high Got it! (1,[4,10,2,10,8,10,6,6,3,7,2,6,3,4,9,4,8,6,7]) On Sat, Dec 18, 2010 at 7:31 AM, Heinrich Apfelmus wrote: > Jacek Generowicz wrote: >> >> # Imagine an activity which may be performed either by a computer, or >> # by a human (alternatively, either locally, or remotely across a >> # network). From Haskell's type system's perspective, these two will >> # look completely different (most obviously, the human (or the >> # network) is wrapped in IO). How can they be made interchangeable ? >> >> # To demonstrate what I mean, I offer the following concrete toy >> # example, in Python. >> >> # It's a harness for playing the trivial higher-lower number guessing >> # game, with interchangeable strategies for either player. In this >> # example I provide two strategies (Computer / ask Human via IO) for >> # each role (asker and guesser). >> >> # How can this sort of interchangeability of computations which are >> # conceptually identical, but incompatible from the types perspective, >> # be expressed in Haskell? > > Have a look at my operational package, in particular the TicTacToe.hs > example on the examples page. > > http://hackage.haskell.org/package/operational > > (Unfortunately, the haskell.org domain is seized at the moment, so this > link won't work for a while. Also, please yell if you can't find the > examples page once the link works again.) > > > Regards, > Heinrich Apfelmus > > -- > http://apfelmus.nfshost.com > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ByteString or Text version of getDirectoryContents
Is there a ByteString or Text version of getDirectoryContents? I am writing a program which scans a filesystem and it runs out of memory using Strings for all the file names, and I would like to avoid the overhead of calling ByteString.pack on the results of getDirectoryContents. I don't mind if it only works on POSIX, but System.Posix.Directory.readDirStream returns a String as well, and looking at how readDirStream is implemented I am left puzzled as it looks like it is using calls to native C functions but I can't find where the C string is turned into a String so I can change it to a ByteString or Text. Thanks, Jesse ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] OT: Monad co-tutorial: the Compilation Monad
The haskell.org domain expired. It's being worked on. On 17 December 2010 12:45, Larry Evans wrote: > On 12/17/10 01:32, Max Bolingbroke wrote: > [snip] >> I can't speak for your monad based approach, but you may be interested >> in Neil Mitchell's Haskell DSL for build systems, called Shake: >> http://community.haskell.org/~ndm/downloads/slides-shake_a_better_make-01_oct_2010.pdf >> > WARNING: I clicked on that link in my thunderbird news reader > and got a page which was something about registering domains. > It was nothing about Neil's slides. > > I then tried directing my Firfox browser to: > > http://community.haskell.org/ > > but got the same web page. > > Am I doing something wrong or has somehow community.haskell.org been > hijacked somehow? > > -Larry > > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Push the envelope. Watch it bend. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] OT: Monad co-tutorial: the Compilation Monad
> Er, it works for me. Maybe *your* DNS has been hijacked? I know lots > of Windows viruses play tricks like this... No, the DNS for haskell.org was down yesterday - if you try again today (after the DNS caches have cleared) it will work. Thanks, Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] DNS problems at haskell.org?
See the thread on the Haskell reddit about it: http://www.reddit.com/r/haskell/comments/encrv/whats_happened_to_haskellorg_did_someone_forget/ I hope it is resolved soon. Regards, Bas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why is Haskell flagging this?
On Fri, Dec 17, 2010 at 9:04 AM, michael rice wrote: > I don't understand this error message. Haskell appears not to understand > that 1 is a Num. > > Prelude> :t 1 > 1 :: (Num t) => t > Prelude> :t [1,2,3,4,5] > [1,2,3,4,5] :: (Num t) => [t] > Prelude> > > Michael > > === > > f :: [Int] -> IO [Int] > f lst = do return lst > > main = do let lst = f [1,2,3,4,5] > fmap (+1) lst f takes [Int] and returns IO [Int] fmap is fmap :: (Functor f) => (a -> b) -> f a -> f b That is it takes a function of a's to b's, a functor of a, and returns you a functor of b. So when you fmap (+1) to an IO [Int], it's trying to add 1 to a [Int], and [Int] is not an instance of Num, so the + does not work. Luckily you can use function composition here (fmap . fmap) (+1) $ f [1..10] [2,3,4,5,6,7,8,9,10,11] fmap . fmap is the type I think you wanted: Prelude> :t fmap . fmap fmap . fmap :: (Functor f, Functor f1) => (a -> b) -> f (f1 a) -> f (f1 b) With IO as the f Functor, and [] as the f1 Functor. > > > === > > Prelude> :l test > [1 of 1] Compiling Main ( test.hs, interpreted ) > > test.hs:5:17: > No instance for (Num [Int]) > arising from the literal `1' at test.hs:5:17 > Possible fix: add an instance declaration for (Num [Int]) > In the second argument of `(+)', namely `1' > In the first argument of `fmap', namely `(+ 1)' > In the expression: fmap (+ 1) lst > Failed, modules loaded: none. > Prelude> > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] DNS problems at haskell.org?
For me only hackage.haskell.org works (resolves to 69.30.63.204), www.haskell.org shows parked domain (209.62.105.19) Pavel On 17.12.2010, at 17:01, Eugene Kirpichov wrote: > Hello. > > For a couple of friends of mine, hackage.haskell.org happens to > resolve to something strange (parked domain), though haskell.org works > ok. This might be something to tell to haskell.org admins. > > Find below an example tracert (messages in Russian have been translated). > > C:\Program Files (x86)\Far2>tracert hackage.haskell.org > > Tracing to hackage.haskell.org [209.62.105.19], max hops = 30 > > 1 8 ms 4 ms 4 ms bsr01.nn.ertelecom.ru [91.144.184.69] > 2 **2 ms net184-77.nn.ertelecom.ru [91.144.184.77] > 313 ms 9 ms 9 ms > NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] > 4 9 ms29 ms 9 ms 83.229.226.101 > 510 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net > [195.34.38.37] > 6 142 ms 142 ms 142 ms ss-crs-1-be3.msk.stream-internet.net > [195.34.53.86] > 7 142 ms 142 ms 142 ms mar-crs-1-be6.msk.stream-internet.net > [195.34.59.141] > 8 143 ms 142 ms 142 ms oct-crs-1-be1.spb.stream-internet.net > [195.34.53.194] > 9 143 ms 142 ms 142 ms bro-cr01-be3.stk.stream-internet.net > [212.188.1.194] > 1066 ms66 ms66 ms tct-cr01-te5-1.ams.stream-internet.net > [195.34.53.14] > 11 142 ms 307 ms 207 ms sd-cr01-te2-1.nyc.stream-internet.net > [195.34.59.114] > 12 *** Request timed out > 13 179 ms 179 ms 179 ms e8-2.ibr03.dllstx3.networklayer.com > [70.87.253.189] > 14 190 ms 189 ms 190 ms e1-1.ibr01.hstntx2.networklayer.com > [70.87.253.50] > 15 190 ms 190 ms 190 ms te2-2.dsr02.hstntx2.networklayer.com > [74.55.252.38] > 16 184 ms 185 ms 184 ms po2.car3.hstntx2.networklayer.com > [74.55.252.106] > 17 189 ms 189 ms 189 ms ev1s-209-62-105-19.theplanet.com > [209.62.105.19] > > Trace finished > > C:\Program Files (x86)\Far2>tracert haskell.org > > Tracing to haskell.org [78.46.100.180], max hops = 30 > > 1 4 ms 3 ms 2 ms bsr01.nn.ertelecom.ru [91.144.184.69] > 2 *2 ms 2 ms net184-77.nn.ertelecom.ru [91.144.184.77] > 310 ms 9 ms 9 ms > NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] > 4 9 ms 9 ms11 ms 83.229.226.101 > 510 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net > [195.34.38.37] > 655 ms55 ms55 ms ss-crs-1-be3.msk.stream-internet.net > [195.34.53.86] > 753 ms52 ms52 ms m9-crs-1-be9.msk.stream-internet.net > [195.34.59.250] > 855 ms55 ms55 ms bor-crs-1-be1.spb.stream-internet.net > [195.34.53.126] > 952 ms52 ms52 ms anc-cr01-po3.ff.stream-internet.net > [195.34.53.102] > 1052 ms52 ms52 ms anc-cr02-po1.ff.stream-internet.net > [212.188.0.122] > 1156 ms56 ms56 ms decix2-gw.hetzner.de [80.81.193.164] > 1260 ms60 ms60 ms hos-bb1.juniper1.fs.hetzner.de > [213.239.240.242] > 1364 ms61 ms63 ms hos-tr1.ex3k10.rz12.hetzner.de > [213.239.228.139] > 1460 ms60 ms62 ms lambda.haskell.org [78.46.100.180] > > Trace finished > > > -- > Eugene Kirpichov > Senior Software Engineer, > Grid Dynamics http://www.griddynamics.com/ > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] DNS problems at haskell.org?
I can confirm this. If anyone has an immediate problem with this, you can use 8.8.8.8 (google's DNS server) as your DNS server. jor...@jordan-laptop:~$ nslookup hackage.haskell.org 8.8.8.8 Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: hackage.haskell.org Address: 69.30.63.204 jor...@jordan-laptop:~$ On Fri, Dec 17, 2010 at 9:01 AM, Eugene Kirpichov wrote: > Hello. > > For a couple of friends of mine, hackage.haskell.org happens to > resolve to something strange (parked domain), though haskell.org works > ok. This might be something to tell to haskell.org admins. > > Find below an example tracert (messages in Russian have been translated). > > C:\Program Files (x86)\Far2>tracert hackage.haskell.org > > Tracing to hackage.haskell.org [209.62.105.19], max hops = 30 > > 1 8 ms 4 ms 4 ms bsr01.nn.ertelecom.ru [91.144.184.69] > 2 **2 ms net184-77.nn.ertelecom.ru [91.144.184.77] > 313 ms 9 ms 9 ms > NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] > 4 9 ms29 ms 9 ms 83.229.226.101 > 510 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net > [195.34.38.37] > 6 142 ms 142 ms 142 ms ss-crs-1-be3.msk.stream-internet.net > [195.34.53.86] > 7 142 ms 142 ms 142 ms mar-crs-1-be6.msk.stream-internet.net > [195.34.59.141] > 8 143 ms 142 ms 142 ms oct-crs-1-be1.spb.stream-internet.net > [195.34.53.194] > 9 143 ms 142 ms 142 ms bro-cr01-be3.stk.stream-internet.net > [212.188.1.194] > 1066 ms66 ms66 ms tct-cr01-te5-1.ams.stream-internet.net > [195.34.53.14] > 11 142 ms 307 ms 207 ms sd-cr01-te2-1.nyc.stream-internet.net > [195.34.59.114] > 12 *** Request timed out > 13 179 ms 179 ms 179 ms e8-2.ibr03.dllstx3.networklayer.com > [70.87.253.189] > 14 190 ms 189 ms 190 ms e1-1.ibr01.hstntx2.networklayer.com > [70.87.253.50] > 15 190 ms 190 ms 190 ms te2-2.dsr02.hstntx2.networklayer.com > [74.55.252.38] > 16 184 ms 185 ms 184 ms po2.car3.hstntx2.networklayer.com > [74.55.252.106] > 17 189 ms 189 ms 189 ms > ev1s-209-62-105-19.theplanet.com[209.62.105.19] > > Trace finished > > C:\Program Files (x86)\Far2>tracert haskell.org > > Tracing to haskell.org [78.46.100.180], max hops = 30 > > 1 4 ms 3 ms 2 ms bsr01.nn.ertelecom.ru [91.144.184.69] > 2 *2 ms 2 ms net184-77.nn.ertelecom.ru [91.144.184.77] > 310 ms 9 ms 9 ms > NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] > 4 9 ms 9 ms11 ms 83.229.226.101 > 510 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net > [195.34.38.37] > 655 ms55 ms55 ms ss-crs-1-be3.msk.stream-internet.net > [195.34.53.86] > 753 ms52 ms52 ms m9-crs-1-be9.msk.stream-internet.net > [195.34.59.250] > 855 ms55 ms55 ms bor-crs-1-be1.spb.stream-internet.net > [195.34.53.126] > 952 ms52 ms52 ms anc-cr01-po3.ff.stream-internet.net > [195.34.53.102] > 1052 ms52 ms52 ms anc-cr02-po1.ff.stream-internet.net > [212.188.0.122] > 1156 ms56 ms56 ms decix2-gw.hetzner.de [80.81.193.164] > 1260 ms60 ms60 ms > hos-bb1.juniper1.fs.hetzner.de[213.239.240.242] > 1364 ms61 ms63 ms > hos-tr1.ex3k10.rz12.hetzner.de[213.239.228.139] > 1460 ms60 ms62 ms lambda.haskell.org [78.46.100.180] > > Trace finished > > > -- > Eugene Kirpichov > Senior Software Engineer, > Grid Dynamics http://www.griddynamics.com/ > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- /me ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Layout styles and EclipseFP evolution.
Note to community. Design the syntax of a language to support auto indenting. Don't make me repeatedly hit the tab key. John On Thu, Dec 16, 2010 at 8:48 PM, Scott Michel wrote: > Disclaimer: I'm not looking to start a favorite IDE flame war, or resurrect > Emacs vs. VIM vs. Yi vs. discussions. > > I've been helping JP with EclipseFP, with the objective of evolving > EclipseFP into a relatively high productivity IDE for Haskell. EclipseFP > has the potential to mature into a reasonable platform for making routine > coding easy, e.g., a HAppStack plugin that makes writing web apps in Haskell > just as easy as it is for the Java community to write web services. > > I've just added Haskell code templates (*) to EclipseFP and, in the process, > encountered the distinct lack of layout autoindentation. I'm sure it used to > exist, but it doesn't exist today. I've looked at the Emacs haskell-mode.el > indentation style, which I'm inclined to port over. > > Are there other layout autoindentation styles that other people prefer and > believe should be supported? > > > -scooter > > (*) The current development version supports templates like > "let" and you get a let expression inserted. Eventually, if you > were to type "case" and you tab out of the expression between > "case" and "of", you would get the data type's alternatives inserted. > > (**) Don S told me that a similar "case" autocompletion exists in another > IDE. Yes, EclipseFP is just catching up. > > (***) Wishlist: An incremental parser that can accept document > changes/deltas and can look backward from the current point to give better > context for completions, e.g., the previous token before the editor's point > is "import". > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why is Haskell flagging this?
To make that a little clearer, here is code that uses two calls to fmap to drill through two monadic layers: f :: [Int] -> IO [Int] f lst = do return lst main = do let lst = f [1,2,3,4,5] fmap (fmap (+1)) lst So the order of operations is : 1. The first fmap converts an IO [Int] to [Int] and hands it off to the second fmap 2. The second fmap applies the (+1) function to every element of the list. 3. The second fmap re-wraps the elements back into a [Int] 4. The first fmap re-wraps and returns the transformed [Int] into an IO [Int]. -deech On Fri, Dec 17, 2010 at 3:27 PM, aditya siram wrote: > I think it is giving you the error because you the "fmap" in your code is > operating on the IO monad and not the List monad. In order to get it to > work, you can remove the IO layer with ">>=" as below: > > > f :: [Int] -> IO [Int] > f lst = do return lst > > main = do let lst = f [1,2,3,4,5] > lst >>= return . fmap (+1) > > Or you can not wrap the list in IO to begin with, my guess is that you > wrote 'f' to make the compiler happy at some point in development: > main = do let lst = [1,2,3,4,5] > return $ fmap (+1) lst > > -deech > > On Fri, Dec 17, 2010 at 11:04 AM, michael rice wrote: > >> I don't understand this error message. Haskell appears not to understand >> that 1 is a Num. >> >> Prelude> :t 1 >> 1 :: (Num t) => t >> Prelude> :t [1,2,3,4,5] >> [1,2,3,4,5] :: (Num t) => [t] >> Prelude> >> >> Michael >> >> === >> >> f :: [Int] -> IO [Int] >> f lst = do return lst >> >> main = do let lst = f [1,2,3,4,5] >> fmap (+1) lst >> >> === >> >> Prelude> :l test >> [1 of 1] Compiling Main ( test.hs, interpreted ) >> >> test.hs:5:17: >> No instance for (Num [Int]) >> arising from the literal `1' at test.hs:5:17 >> Possible fix: add an instance declaration for (Num [Int]) >> In the second argument of `(+)', namely `1' >> In the first argument of `fmap', namely `(+ 1)' >> In the expression: fmap (+ 1) lst >> Failed, modules loaded: none. >> Prelude> >> >> >> ___ >> Haskell-Cafe mailing list >> Haskell-Cafe@haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7.0.1 developer challenges
On Thu, Dec 16, 2010 at 4:13 AM, Simon Marlow wrote: > > If your program has large memory requirements, you might also benefit from > parallel GC in the old generation: +RTS -N2 -qg1.l Testing shows this advice did not help in my case. The program that implements the undecidable algorithm in my package is already multiprocessor aware, but there is an inheritly sequential support program that translates the output of the main program into an XHTML document. For reasons I shall spare you of, this program is also memory intensive, sometimes requiring more memory that the main program. When this program is compiled without the -threaded option, and run on a large input, I found the program used 85 seconds of user time, and 99% of the CPU time on a Core 2 Duo machine. After compiling with the -threaded option, and running with -N2 -qg1, the program used 88 seconds of user time, and 103% of the CPU. I ran the test on what is provided by the Ubuntu package system for Ubuntu Lucid Lynx, GHC 6.12.1 and parallel 1.1.0.1. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] DNS problems at haskell.org?
I am seeing this from New York. Has the domain expired? dmmb:~ tony$ dig haskell.org ; <<>> DiG 9.6.0-APPLE-P2 <<>> haskell.org ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36391 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2 ;; QUESTION SECTION: ;haskell.org. IN A ;; ANSWER SECTION: haskell.org. 1177 IN A 209.62.105.19 ;; AUTHORITY SECTION: haskell.org. 80371 IN NS ns2.pendingrenewaldeletion.com. haskell.org. 80371 IN NS ns1.pendingrenewaldeletion.com. ;; ADDITIONAL SECTION: ns1.pendingrenewaldeletion.com. 1172 IN A 205.178.190.51 ns2.pendingrenewaldeletion.com. 1172 IN A 205.178.189.51 ;; Query time: 13 msec ;; SERVER: 10.3.1.40#53(10.3.1.40) ;; WHEN: Fri Dec 17 12:27:58 2010 ;; MSG SIZE rcvd: 139 On Fri, Dec 17, 2010 at 9:01 AM, Eugene Kirpichov wrote: > Hello. > > For a couple of friends of mine, hackage.haskell.org happens to > resolve to something strange (parked domain), though haskell.org works > ok. This might be something to tell to haskell.org admins. > > Find below an example tracert (messages in Russian have been translated). > > C:\Program Files (x86)\Far2>tracert hackage.haskell.org > > Tracing to hackage.haskell.org [209.62.105.19], max hops = 30 > > 1 8 ms 4 ms 4 ms bsr01.nn.ertelecom.ru [91.144.184.69] > 2 **2 ms net184-77.nn.ertelecom.ru [91.144.184.77] > 313 ms 9 ms 9 ms > NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] > 4 9 ms29 ms 9 ms 83.229.226.101 > 510 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net > [195.34.38.37] > 6 142 ms 142 ms 142 ms ss-crs-1-be3.msk.stream-internet.net > [195.34.53.86] > 7 142 ms 142 ms 142 ms mar-crs-1-be6.msk.stream-internet.net > [195.34.59.141] > 8 143 ms 142 ms 142 ms oct-crs-1-be1.spb.stream-internet.net > [195.34.53.194] > 9 143 ms 142 ms 142 ms bro-cr01-be3.stk.stream-internet.net > [212.188.1.194] > 1066 ms66 ms66 ms tct-cr01-te5-1.ams.stream-internet.net > [195.34.53.14] > 11 142 ms 307 ms 207 ms sd-cr01-te2-1.nyc.stream-internet.net > [195.34.59.114] > 12 *** Request timed out > 13 179 ms 179 ms 179 ms e8-2.ibr03.dllstx3.networklayer.com > [70.87.253.189] > 14 190 ms 189 ms 190 ms e1-1.ibr01.hstntx2.networklayer.com > [70.87.253.50] > 15 190 ms 190 ms 190 ms te2-2.dsr02.hstntx2.networklayer.com > [74.55.252.38] > 16 184 ms 185 ms 184 ms po2.car3.hstntx2.networklayer.com > [74.55.252.106] > 17 189 ms 189 ms 189 ms > ev1s-209-62-105-19.theplanet.com[209.62.105.19] > > Trace finished > > C:\Program Files (x86)\Far2>tracert haskell.org > > Tracing to haskell.org [78.46.100.180], max hops = 30 > > 1 4 ms 3 ms 2 ms bsr01.nn.ertelecom.ru [91.144.184.69] > 2 *2 ms 2 ms net184-77.nn.ertelecom.ru [91.144.184.77] > 310 ms 9 ms 9 ms > NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] > 4 9 ms 9 ms11 ms 83.229.226.101 > 510 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net > [195.34.38.37] > 655 ms55 ms55 ms ss-crs-1-be3.msk.stream-internet.net > [195.34.53.86] > 753 ms52 ms52 ms m9-crs-1-be9.msk.stream-internet.net > [195.34.59.250] > 855 ms55 ms55 ms bor-crs-1-be1.spb.stream-internet.net > [195.34.53.126] > 952 ms52 ms52 ms anc-cr01-po3.ff.stream-internet.net > [195.34.53.102] > 1052 ms52 ms52 ms anc-cr02-po1.ff.stream-internet.net > [212.188.0.122] > 1156 ms56 ms56 ms decix2-gw.hetzner.de [80.81.193.164] > 1260 ms60 ms60 ms > hos-bb1.juniper1.fs.hetzner.de[213.239.240.242] > 1364 ms61 ms63 ms > hos-tr1.ex3k10.rz12.hetzner.de[213.239.228.139] > 1460 ms60 ms62 ms lambda.haskell.org [78.46.100.180] > > Trace finished > > > -- > Eugene Kirpichov > Senior Software Engineer, > Grid Dynamics http://www.griddynamics.com/ > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [URGENT] DNS problems at haskell.org?
Karel Gardas writes: > http://www.reddit.com/r/haskell/comments/encrv/whats_happened_to_haskellorg_did_someone_forget/c19guw1 Quoth dons: | The domain name was seized by Network Solutions (it wasn't due to | expire until this time next year). The confusion seems to be that | while Yale was the nominated owner, it was administered by Galois. | We've contacted Network Solutions and resolve their confusion. Would it be impertinent to question the wisdom of using a domain provider that just breaks a paid-for and working site without contacting the owner? How about contacting another, more professional registrar instead of Network Solution? http://www.host-shopper.com/web-hosts-reviews.html?sortBy=rating -k -- If I haven't seen further, it is by standing in the footprints of giants ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] DNS problems at haskell.org?
It's fixed now. Try www.haskell.org. Check out http://www.reddit.com/r/haskell/comments/encrv/whats_happened_to_haskellorg_did_someone_forget/ for more discussion. -deech On Sat, Dec 18, 2010 at 9:12 AM, John D. Ramsdell wrote: > I think someone failed to pay a bill for using the domain name haskell.org. > > John > > On Fri, Dec 17, 2010 at 12:05 PM, aditya siram wrote: >> I have the same problem. >> -deech >> >> >> On Fri, Dec 17, 2010 at 8:01 AM, Eugene Kirpichov >> wrote: >>> Hello. >>> >>> For a couple of friends of mine, hackage.haskell.org happens to >>> resolve to something strange (parked domain), though haskell.org works >>> ok. This might be something to tell to haskell.org admins. >>> >>> Find below an example tracert (messages in Russian have been translated). >>> >>> C:\Program Files (x86)\Far2>tracert hackage.haskell.org >>> >>> Tracing to hackage.haskell.org [209.62.105.19], max hops = 30 >>> >>> 1 8 ms 4 ms 4 ms bsr01.nn.ertelecom.ru [91.144.184.69] >>> 2 * * 2 ms net184-77.nn.ertelecom.ru [91.144.184.77] >>> 3 13 ms 9 ms 9 ms >>> NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] >>> 4 9 ms 29 ms 9 ms 83.229.226.101 >>> 5 10 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net >>> [195.34.38.37] >>> 6 142 ms 142 ms 142 ms ss-crs-1-be3.msk.stream-internet.net >>> [195.34.53.86] >>> 7 142 ms 142 ms 142 ms mar-crs-1-be6.msk.stream-internet.net >>> [195.34.59.141] >>> 8 143 ms 142 ms 142 ms oct-crs-1-be1.spb.stream-internet.net >>> [195.34.53.194] >>> 9 143 ms 142 ms 142 ms bro-cr01-be3.stk.stream-internet.net >>> [212.188.1.194] >>> 10 66 ms 66 ms 66 ms tct-cr01-te5-1.ams.stream-internet.net >>> [195.34.53.14] >>> 11 142 ms 307 ms 207 ms sd-cr01-te2-1.nyc.stream-internet.net >>> [195.34.59.114] >>> 12 * * * Request timed out >>> 13 179 ms 179 ms 179 ms e8-2.ibr03.dllstx3.networklayer.com >>> [70.87.253.189] >>> 14 190 ms 189 ms 190 ms e1-1.ibr01.hstntx2.networklayer.com >>> [70.87.253.50] >>> 15 190 ms 190 ms 190 ms te2-2.dsr02.hstntx2.networklayer.com >>> [74.55.252.38] >>> 16 184 ms 185 ms 184 ms po2.car3.hstntx2.networklayer.com >>> [74.55.252.106] >>> 17 189 ms 189 ms 189 ms ev1s-209-62-105-19.theplanet.com >>> [209.62.105.19] >>> >>> Trace finished >>> >>> C:\Program Files (x86)\Far2>tracert haskell.org >>> >>> Tracing to haskell.org [78.46.100.180], max hops = 30 >>> >>> 1 4 ms 3 ms 2 ms bsr01.nn.ertelecom.ru [91.144.184.69] >>> 2 * 2 ms 2 ms net184-77.nn.ertelecom.ru [91.144.184.77] >>> 3 10 ms 9 ms 9 ms >>> NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] >>> 4 9 ms 9 ms 11 ms 83.229.226.101 >>> 5 10 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net >>> [195.34.38.37] >>> 6 55 ms 55 ms 55 ms ss-crs-1-be3.msk.stream-internet.net >>> [195.34.53.86] >>> 7 53 ms 52 ms 52 ms m9-crs-1-be9.msk.stream-internet.net >>> [195.34.59.250] >>> 8 55 ms 55 ms 55 ms bor-crs-1-be1.spb.stream-internet.net >>> [195.34.53.126] >>> 9 52 ms 52 ms 52 ms anc-cr01-po3.ff.stream-internet.net >>> [195.34.53.102] >>> 10 52 ms 52 ms 52 ms anc-cr02-po1.ff.stream-internet.net >>> [212.188.0.122] >>> 11 56 ms 56 ms 56 ms decix2-gw.hetzner.de [80.81.193.164] >>> 12 60 ms 60 ms 60 ms hos-bb1.juniper1.fs.hetzner.de >>> [213.239.240.242] >>> 13 64 ms 61 ms 63 ms hos-tr1.ex3k10.rz12.hetzner.de >>> [213.239.228.139] >>> 14 60 ms 60 ms 62 ms lambda.haskell.org [78.46.100.180] >>> >>> Trace finished >>> >>> >>> -- >>> Eugene Kirpichov >>> Senior Software Engineer, >>> Grid Dynamics http://www.griddynamics.com/ >>> >>> ___ >>> Haskell-Cafe mailing list >>> Haskell-Cafe@haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> >> ___ >> Haskell-Cafe mailing list >> Haskell-Cafe@haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] DNS problems at haskell.org?
I think someone failed to pay a bill for using the domain name haskell.org. John On Fri, Dec 17, 2010 at 12:05 PM, aditya siram wrote: > I have the same problem. > -deech > > > On Fri, Dec 17, 2010 at 8:01 AM, Eugene Kirpichov > wrote: >> Hello. >> >> For a couple of friends of mine, hackage.haskell.org happens to >> resolve to something strange (parked domain), though haskell.org works >> ok. This might be something to tell to haskell.org admins. >> >> Find below an example tracert (messages in Russian have been translated). >> >> C:\Program Files (x86)\Far2>tracert hackage.haskell.org >> >> Tracing to hackage.haskell.org [209.62.105.19], max hops = 30 >> >> 1 8 ms 4 ms 4 ms bsr01.nn.ertelecom.ru [91.144.184.69] >> 2 * * 2 ms net184-77.nn.ertelecom.ru [91.144.184.77] >> 3 13 ms 9 ms 9 ms >> NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] >> 4 9 ms 29 ms 9 ms 83.229.226.101 >> 5 10 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net >> [195.34.38.37] >> 6 142 ms 142 ms 142 ms ss-crs-1-be3.msk.stream-internet.net >> [195.34.53.86] >> 7 142 ms 142 ms 142 ms mar-crs-1-be6.msk.stream-internet.net >> [195.34.59.141] >> 8 143 ms 142 ms 142 ms oct-crs-1-be1.spb.stream-internet.net >> [195.34.53.194] >> 9 143 ms 142 ms 142 ms bro-cr01-be3.stk.stream-internet.net >> [212.188.1.194] >> 10 66 ms 66 ms 66 ms tct-cr01-te5-1.ams.stream-internet.net >> [195.34.53.14] >> 11 142 ms 307 ms 207 ms sd-cr01-te2-1.nyc.stream-internet.net >> [195.34.59.114] >> 12 * * * Request timed out >> 13 179 ms 179 ms 179 ms e8-2.ibr03.dllstx3.networklayer.com >> [70.87.253.189] >> 14 190 ms 189 ms 190 ms e1-1.ibr01.hstntx2.networklayer.com >> [70.87.253.50] >> 15 190 ms 190 ms 190 ms te2-2.dsr02.hstntx2.networklayer.com >> [74.55.252.38] >> 16 184 ms 185 ms 184 ms po2.car3.hstntx2.networklayer.com >> [74.55.252.106] >> 17 189 ms 189 ms 189 ms ev1s-209-62-105-19.theplanet.com >> [209.62.105.19] >> >> Trace finished >> >> C:\Program Files (x86)\Far2>tracert haskell.org >> >> Tracing to haskell.org [78.46.100.180], max hops = 30 >> >> 1 4 ms 3 ms 2 ms bsr01.nn.ertelecom.ru [91.144.184.69] >> 2 * 2 ms 2 ms net184-77.nn.ertelecom.ru [91.144.184.77] >> 3 10 ms 9 ms 9 ms >> NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] >> 4 9 ms 9 ms 11 ms 83.229.226.101 >> 5 10 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net >> [195.34.38.37] >> 6 55 ms 55 ms 55 ms ss-crs-1-be3.msk.stream-internet.net >> [195.34.53.86] >> 7 53 ms 52 ms 52 ms m9-crs-1-be9.msk.stream-internet.net >> [195.34.59.250] >> 8 55 ms 55 ms 55 ms bor-crs-1-be1.spb.stream-internet.net >> [195.34.53.126] >> 9 52 ms 52 ms 52 ms anc-cr01-po3.ff.stream-internet.net >> [195.34.53.102] >> 10 52 ms 52 ms 52 ms anc-cr02-po1.ff.stream-internet.net >> [212.188.0.122] >> 11 56 ms 56 ms 56 ms decix2-gw.hetzner.de [80.81.193.164] >> 12 60 ms 60 ms 60 ms hos-bb1.juniper1.fs.hetzner.de >> [213.239.240.242] >> 13 64 ms 61 ms 63 ms hos-tr1.ex3k10.rz12.hetzner.de >> [213.239.228.139] >> 14 60 ms 60 ms 62 ms lambda.haskell.org [78.46.100.180] >> >> Trace finished >> >> >> -- >> Eugene Kirpichov >> Senior Software Engineer, >> Grid Dynamics http://www.griddynamics.com/ >> >> ___ >> Haskell-Cafe mailing list >> Haskell-Cafe@haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [URGENT] DNS problems at haskell.org?
Hello, please read: http://www.reddit.com/r/haskell/comments/encrv/whats_happened_to_haskellorg_did_someone_forget/c19guw1 Thanks, Karel On 12/17/10 03:19 PM, Stephane Bortzmeyer wrote: On Fri, Dec 17, 2010 at 05:01:45PM +0300, Eugene Kirpichov wrote a message of 82 lines which said: For a couple of friends of mine, hackage.haskell.org happens to resolve to something strange (parked domain), though haskell.org works ok. This might be something to tell to haskell.org admins. Indeed, someone forgot to pay the bill and the domain will soon be sold or deleted. % whois haskell.org ... Last Updated On:17-Dec-2010 10:12:28 UTC ... Sponsoring Registrar:Network Solutions LLC (R63-LROR) ... Registrant ID:DOMAIN-RESALE Registrant Name:Pending Renewal or Deletion ... Name Server:NS1.PENDINGRENEWALDELETION.COM Name Server:NS2.PENDINGRENEWALDELETION.COM ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [URGENT] DNS problems at haskell.org?
On Fri, Dec 17, 2010 at 05:01:45PM +0300, Eugene Kirpichov wrote a message of 82 lines which said: > For a couple of friends of mine, hackage.haskell.org happens to > resolve to something strange (parked domain), though haskell.org works > ok. This might be something to tell to haskell.org admins. Indeed, someone forgot to pay the bill and the domain will soon be sold or deleted. % whois haskell.org ... Last Updated On:17-Dec-2010 10:12:28 UTC ... Sponsoring Registrar:Network Solutions LLC (R63-LROR) ... Registrant ID:DOMAIN-RESALE Registrant Name:Pending Renewal or Deletion ... Name Server:NS1.PENDINGRENEWALDELETION.COM Name Server:NS2.PENDINGRENEWALDELETION.COM signature.asc Description: Digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] DNS problems at haskell.org?
I have the same problem. -deech On Fri, Dec 17, 2010 at 8:01 AM, Eugene Kirpichov wrote: > Hello. > > For a couple of friends of mine, hackage.haskell.org happens to > resolve to something strange (parked domain), though haskell.org works > ok. This might be something to tell to haskell.org admins. > > Find below an example tracert (messages in Russian have been translated). > > C:\Program Files (x86)\Far2>tracert hackage.haskell.org > > Tracing to hackage.haskell.org [209.62.105.19], max hops = 30 > > 1 8 ms 4 ms 4 ms bsr01.nn.ertelecom.ru [91.144.184.69] > 2 * * 2 ms net184-77.nn.ertelecom.ru [91.144.184.77] > 3 13 ms 9 ms 9 ms > NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] > 4 9 ms 29 ms 9 ms 83.229.226.101 > 5 10 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net > [195.34.38.37] > 6 142 ms 142 ms 142 ms ss-crs-1-be3.msk.stream-internet.net > [195.34.53.86] > 7 142 ms 142 ms 142 ms mar-crs-1-be6.msk.stream-internet.net > [195.34.59.141] > 8 143 ms 142 ms 142 ms oct-crs-1-be1.spb.stream-internet.net > [195.34.53.194] > 9 143 ms 142 ms 142 ms bro-cr01-be3.stk.stream-internet.net > [212.188.1.194] > 10 66 ms 66 ms 66 ms tct-cr01-te5-1.ams.stream-internet.net > [195.34.53.14] > 11 142 ms 307 ms 207 ms sd-cr01-te2-1.nyc.stream-internet.net > [195.34.59.114] > 12 * * * Request timed out > 13 179 ms 179 ms 179 ms e8-2.ibr03.dllstx3.networklayer.com > [70.87.253.189] > 14 190 ms 189 ms 190 ms e1-1.ibr01.hstntx2.networklayer.com > [70.87.253.50] > 15 190 ms 190 ms 190 ms te2-2.dsr02.hstntx2.networklayer.com > [74.55.252.38] > 16 184 ms 185 ms 184 ms po2.car3.hstntx2.networklayer.com > [74.55.252.106] > 17 189 ms 189 ms 189 ms ev1s-209-62-105-19.theplanet.com > [209.62.105.19] > > Trace finished > > C:\Program Files (x86)\Far2>tracert haskell.org > > Tracing to haskell.org [78.46.100.180], max hops = 30 > > 1 4 ms 3 ms 2 ms bsr01.nn.ertelecom.ru [91.144.184.69] > 2 * 2 ms 2 ms net184-77.nn.ertelecom.ru [91.144.184.77] > 3 10 ms 9 ms 9 ms > NNOV-D2-HQ-XX---1-3-0.499.main.synterra.ru [83.229.187.17] > 4 9 ms 9 ms 11 ms 83.229.226.101 > 5 10 ms 9 ms 9 ms m9-cr01-te4-3.msk.stream-internet.net > [195.34.38.37] > 6 55 ms 55 ms 55 ms ss-crs-1-be3.msk.stream-internet.net > [195.34.53.86] > 7 53 ms 52 ms 52 ms m9-crs-1-be9.msk.stream-internet.net > [195.34.59.250] > 8 55 ms 55 ms 55 ms bor-crs-1-be1.spb.stream-internet.net > [195.34.53.126] > 9 52 ms 52 ms 52 ms anc-cr01-po3.ff.stream-internet.net > [195.34.53.102] > 10 52 ms 52 ms 52 ms anc-cr02-po1.ff.stream-internet.net > [212.188.0.122] > 11 56 ms 56 ms 56 ms decix2-gw.hetzner.de [80.81.193.164] > 12 60 ms 60 ms 60 ms hos-bb1.juniper1.fs.hetzner.de > [213.239.240.242] > 13 64 ms 61 ms 63 ms hos-tr1.ex3k10.rz12.hetzner.de > [213.239.228.139] > 14 60 ms 60 ms 62 ms lambda.haskell.org [78.46.100.180] > > Trace finished > > > -- > Eugene Kirpichov > Senior Software Engineer, > Grid Dynamics http://www.griddynamics.com/ > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7.0.1 developer challenges
On Fri, Dec 17, 2010 at 3:03 AM, Ketil Malde wrote: > > So I still think the 80% rule is pretty good - it's simple, and > although it isn't optimal in all cases, it's conservative in that any > larger bound is almost certainly going to thrash. Please test the 80% rule, and report the results of your experiments. Be sure to explain your experimental method. Otherwise, I don't see any merit to it. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why is Haskell flagging this?
Hi Michael The type of lst is "IO [Int]" and therefore "fmap (+1)" applies (+1) to the hole lists of integers, and not to each member of the list. That is: fmap (+1) lst <=> fmap (+1) (return [1,2,3,4,5]) <=> return ([1,2,3,4,5] + 1) and you cannot say [1,2,3,4,5] + 1. Does that make sense? Maybe you want to say: main = do let lst = [1,2,3,4,5] print $ map (+1) lst /Mads On Fri, 2010-12-17 at 09:04 -0800, michael rice wrote: > I don't understand this error message. Haskell appears not to > understand that 1 is a Num. > > Prelude> :t 1 > 1 :: (Num t) => t > Prelude> :t [1,2,3,4,5] > [1,2,3,4,5] :: (Num t) => [t] > Prelude> > > Michael > > === > > f :: [Int] -> IO [Int] > f lst = do return lst > > main = do let lst = f [1,2,3,4,5] > fmap (+1) lst > > === > > Prelude> :l test > [1 of 1] Compiling Main ( test.hs, interpreted ) > > test.hs:5:17: > No instance for (Num [Int]) > arising from the literal `1' at test.hs:5:17 > Possible fix: add an instance declaration for (Num [Int]) > In the second argument of `(+)', namely `1' > In the first argument of `fmap', namely `(+ 1)' > In the expression: fmap (+ 1) lst > Failed, modules loaded: none. > Prelude> > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7.0.1 developer challenges
You might like to read about free and reclaimable memory on Linux systems. I recommend that you go http://linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html and run the C programs that are included in the article. Another good way to learn about Linux memory is to Google with the search keys of "linux free and reclaimable memory /proc/meminfo". The results will contain many URLs of interest. John On Fri, Dec 17, 2010 at 3:03 AM, Ketil Malde wrote: > "John D. Ramsdell" writes: > >>> In absence of any explicit limits, I think a sensible default is to set >>> maximum total memory use to something like 80%-90% of physical RAM. > >> This would be a poor choice on Linux systems. As I've argued >> previously in this thread, the best choice is to limit the GHC runtime >> to the free memory and the reclaimable memory of the machine. > > Well - it depends, I think. In principle, I would like to be > conservative (i.e. set the limit as high as possible), since a too low > limit could possibly make my program fail. > >> On the laptop I'm using right now, physical memory is 1G. Free memory >> is 278M, and free plus reclaimable memory is 590M. I'm just running >> Firefox and X, so the OS as allocated a lot of memory to caches. > > But lots of the memory in use is likely to be inactive (not in the > current working set of any application), and will be pushed to swap if > you start asking for more. Which is often what you want. > > If I interpret these numbers correctly, my laptop is using 1.5G on stuff > that is basically idle - word processor documents, PDF displayers, a ton > of web pages (with all the flash carefully filtered out), emacs buffers, > a half-finished inkscape graphic, and so on. Most of this could easily > go to swap. > >> Note that if you limit the GHC runtime to free plus reclaimable >> memory, and some other process is chewing up memory, the GHC limit >> would be small. > > Or if you run two copies of your program - then one would get all the > memory, and the other none. > >> But this would ensure both do not thrash, a good thing, right? > > Unless the second program actually *needs* the memory. > > So I still think the 80% rule is pretty good - it's simple, and > although it isn't optimal in all cases, it's conservative in that any > larger bound is almost certainly going to thrash. > > You could probably invent more advanced memory behavior on top of that, > say switching to compacting GC if you detect thrashing. > > -k > -- > If I haven't seen further, it is by standing in the footprints of giants > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] OT: Monad co-tutorial: the Compilation Monad
On 12/17/10 07:07, Daniel Fischer wrote: > On Friday 17 December 2010 13:45:38, Larry Evans wrote: >> WARNING: I clicked on that link in my thunderbird news reader >> and got a page which was something about registering domains. >> It was nothing about Neil's slides. >> >> I then tried directing my Firfox browser to: >> >> http://community.haskell.org/ >> >> but got the same web page. >> >> Am I doing something wrong or has somehow community.haskell.org been >> hijacked somehow? >> >> -Larry >> > > It seems the haskell.org domain hasn't been renewed on time. Yes, it works for me now. Thanks for all the replies explaining the reason. BTW, I found the video for the talk here: http://vimeo.com/15465133 -regards, Larry ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Making type-incompatible strategies interchangeable
Jacek Generowicz wrote: # Imagine an activity which may be performed either by a computer, or # by a human (alternatively, either locally, or remotely across a # network). From Haskell's type system's perspective, these two will # look completely different (most obviously, the human (or the # network) is wrapped in IO). How can they be made interchangeable ? # To demonstrate what I mean, I offer the following concrete toy # example, in Python. # It's a harness for playing the trivial higher-lower number guessing # game, with interchangeable strategies for either player. In this # example I provide two strategies (Computer / ask Human via IO) for # each role (asker and guesser). # How can this sort of interchangeability of computations which are # conceptually identical, but incompatible from the types perspective, # be expressed in Haskell? Have a look at my operational package, in particular the TicTacToe.hs example on the examples page. http://hackage.haskell.org/package/operational (Unfortunately, the haskell.org domain is seized at the moment, so this link won't work for a while. Also, please yell if you can't find the examples page once the link works again.) Regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why is Haskell flagging this?
This is a bit tricky. The type of 'f' is '[Int] -> IO [Int]', which means that the type of 'lst' is 'IO [Int]'. So fmap (+1) tries to add one to the [Int] underneath the 'IO' type constructor. You can either use two 'fmap's, the first to lift up to IO and the second to lift into the list, or you can use monad notation: > do > lst <- f [1,2,3,4] > return $ fmap (+1) lst Does that make sense? Take care, Antoine On Fri, Dec 17, 2010 at 11:04 AM, michael rice wrote: > I don't understand this error message. Haskell appears not to understand > that 1 is a Num. > > Prelude> :t 1 > 1 :: (Num t) => t > Prelude> :t [1,2,3,4,5] > [1,2,3,4,5] :: (Num t) => [t] > Prelude> > > Michael > > === > > f :: [Int] -> IO [Int] > f lst = do return lst > > main = do let lst = f [1,2,3,4,5] > fmap (+1) lst > > === > > Prelude> :l test > [1 of 1] Compiling Main ( test.hs, interpreted ) > > test.hs:5:17: > No instance for (Num [Int]) > arising from the literal `1' at test.hs:5:17 > Possible fix: add an instance declaration for (Num [Int]) > In the second argument of `(+)', namely `1' > In the first argument of `fmap', namely `(+ 1)' > In the expression: fmap (+ 1) lst > Failed, modules loaded: none. > Prelude> > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why is Haskell flagging this?
I think it is giving you the error because you the "fmap" in your code is operating on the IO monad and not the List monad. In order to get it to work, you can remove the IO layer with ">>=" as below: f :: [Int] -> IO [Int] f lst = do return lst main = do let lst = f [1,2,3,4,5] lst >>= return . fmap (+1) Or you can not wrap the list in IO to begin with, my guess is that you wrote 'f' to make the compiler happy at some point in development: main = do let lst = [1,2,3,4,5] return $ fmap (+1) lst -deech On Fri, Dec 17, 2010 at 11:04 AM, michael rice wrote: > I don't understand this error message. Haskell appears not to understand > that 1 is a Num. > > Prelude> :t 1 > 1 :: (Num t) => t > Prelude> :t [1,2,3,4,5] > [1,2,3,4,5] :: (Num t) => [t] > Prelude> > > Michael > > === > > f :: [Int] -> IO [Int] > f lst = do return lst > > main = do let lst = f [1,2,3,4,5] > fmap (+1) lst > > === > > Prelude> :l test > [1 of 1] Compiling Main ( test.hs, interpreted ) > > test.hs:5:17: > No instance for (Num [Int]) > arising from the literal `1' at test.hs:5:17 > Possible fix: add an instance declaration for (Num [Int]) > In the second argument of `(+)', namely `1' > In the first argument of `fmap', namely `(+ 1)' > In the expression: fmap (+ 1) lst > Failed, modules loaded: none. > Prelude> > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] OT: Monad co-tutorial: the Compilation Monad
On 17 December 2010 12:45, Larry Evans wrote: > Am I doing something wrong or has somehow community.haskell.org been > hijacked somehow? Er, it works for me. Maybe *your* DNS has been hijacked? I know lots of Windows viruses play tricks like this... Max ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] OT: Monad co-tutorial: the Compilation Monad
On 17/12/2010 12:59 AM, Gregg Reynolds wrote: This is a little off-topic, since it isn't specifically about Haskell, but since Haskell is the home of the monad tutorial it isn't completely irrelevant. The monad tutorial genre is well-known; it's often written somebody who has just learned the concept trying to explain it, often in highly imaginative terms (e.g. "a monad is just like a giant squid, with special tentacles"). I propose "monad co-tutorial" for attempts, often by an amateur (e.g. me) to work out how a monad appears in an unexpected place. I've been off work all week due to illness, and I feel rotten. But this paragraph gave me a much-needed giggle. Thanks for that! Never mind monoids in the category of endofunctors. The only endofunctor I'm looking for is the one from the category is miserable, virus-ridden humans to the category of people who feel half human. >_< ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why is Haskell flagging this?
On Fri, Dec 17, 2010 at 11:04 AM, michael rice wrote: > I don't understand this error message. Haskell appears not to understand > that 1 is a Num. > > Prelude> :t 1 > 1 :: (Num t) => t > Prelude> :t [1,2,3,4,5] > [1,2,3,4,5] :: (Num t) => [t] > Prelude> > > Michael > > === > > f :: [Int] -> IO [Int] > f lst = do return lst > > main = do let lst = f [1,2,3,4,5] > fmap (+1) lst > > === > > Prelude> :l test > [1 of 1] Compiling Main ( test.hs, interpreted ) > > test.hs:5:17: > No instance for (Num [Int]) > arising from the literal `1' at test.hs:5:17 > Possible fix: add an instance declaration for (Num [Int]) > In the second argument of `(+)', namely `1' > In the first argument of `fmap', namely `(+ 1)' > In the expression: fmap (+ 1) lst > Failed, modules loaded: none. > Prelude> > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > Excuse any inaccuracies, I'm somewhat new at Haskell myself, but what it looks like is happening is that at the point in main where you've bound "lst", it will have type of "IO [Int]". The signature for fmap is: fmap :: (Functor f) => (a -> b) -> f a -> f b if you call fmap (+1) the next argument that fmap "expects" is something that is "in" just one functor, for example, this fmap (+1) [1,2,3,4,5] works fine, but, something that is "IO [Int]" won't. You can compose two 'fmap's to solve this: :t (fmap.fmap) (fmap.fmap) :: (Functor f, Functor f1) => (a -> b) -> f (f1 a) -> f (f1 b) which means that 'main' looks like: main = do let lst = f [1, 2, 3, 4, 5] (fmap.fmap) (+1) lst -- Chris Wilson ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe