Re: [Haskell-cafe] ANNOUNCE: taffybar: an alternative status bar for xmonad
On Sat, Aug 13, 2011 at 09:54:13PM -0700, Joel Burget wrote: > This sounds really intriguing. Since I'm temporarily not using xmonad, and > I'm sure others would like to see as well, could we get a screenshot? Oops, how could I forget. http://pages.cs.wisc.edu/~travitch/taffybar.jpg I have the xmonad log on the left, a CPU graph, memory graph, date/time, weather, and then system tray visible there. signature.asc Description: Digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: taffybar: an alternative status bar for xmonad
This sounds really intriguing. Since I'm temporarily not using xmonad, and I'm sure others would like to see as well, could we get a screenshot? - Joel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Array and Ix for custom Graph ADT
Solved it with your help :) Thanks for your assistance! Mark Spezzano On 14/08/2011, at 8:29 AM, Daniel Fischer wrote: > On Sunday 14 August 2011, 00:41:33, Mark Spezzano wrote: >> Hi Antoine, >> >> The first Int field is a unique index, beginning at 1 and increasing by >> 1 for each unique Node. > > Then you could use that for indexing, assuming the Ord instance matches. > > range (MyNode x _ _ _, MyNode y _ _ _) = [x .. y] > index (MyNode x _ _ _, MyNode y _ _ _) (MyNode z _ _ _) > | x <= z && z <= y = z-x > | otherwise = error ("Index out of range: " ++ show z) > > etc. > >> The second [Int] field is just a list of random >> numbers associated with that node. >> >> Mark > > ___ > 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] Diffs for hackage
On 8/13/11 5:39 PM, Joachim Breitner wrote: Hi, Am Samstag, den 13.08.2011, 12:57 +0200 schrieb Joachim Breitner: Maybe it would already help to add a "changelog-file" field to .cabal, just as with license-file, and reject packages on hackage that do not have this field and file, and later decide if we need a more standardized format for changelogs. here is a first step in improving the Haskell ecosystem with that regard: The patch attached to http://hackage.haskell.org/trac/hackage/ticket/873 makes "cabal check" remind the author that a changelog file is good practice (without fixing a name or format, or adding a field to the .cabal file). I hope it gets applied (hence CC’ing cabal-devel). Changing developers’ behavior by nudging tools is something that works great in Debian – if you want a change to get implemented across multiple packages, make sure lintian tells you about it. Hoping that people tend to run cabal check before uploading their package, they would now be reminded to include a changelog file. +1. The next steps towards great changes documentation would then be: * Defining a changelog-file field in cabal. * Adding support to hackage to display the changelog. * Possibly define a suggested format for changelogs. At the risk of overengineering, perhaps the easiest way to deal with format bikeshedding is just to define an enumeration of formats just like the enumeration of licenses. That way machine-readable formats are annotated by which machine should read them, but crotchety developers don't have to change their changelogging preferences. After that's in place, then we can worry about the social pressure to get the community to agree on a smaller set of formats (just like has happened with licenses). -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Array and Ix for custom Graph ADT
On Sunday 14 August 2011, 00:41:33, Mark Spezzano wrote: > Hi Antoine, > > The first Int field is a unique index, beginning at 1 and increasing by > 1 for each unique Node. Then you could use that for indexing, assuming the Ord instance matches. range (MyNode x _ _ _, MyNode y _ _ _) = [x .. y] index (MyNode x _ _ _, MyNode y _ _ _) (MyNode z _ _ _) | x <= z && z <= y = z-x | otherwise = error ("Index out of range: " ++ show z) etc. > The second [Int] field is just a list of random > numbers associated with that node. > > Mark ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Array and Ix for custom Graph ADT
Hi Antoine, The first Int field is a unique index, beginning at 1 and increasing by 1 for each unique Node. The second [Int] field is just a list of random numbers associated with that node. Mark On 14/08/2011, at 2:13 AM, Antoine Latter wrote: > On Sat, Aug 13, 2011 at 4:37 AM, Mark Spezzano > wrote: >> Hi, >> >> I'm creating a Graph data structure, and I want to use the array list >> approach, implemented as an Array. >> >> I need my Nodes to be instances of Ix for this to work and my Node type is >> roughly as follows: >> >> data Node = MyNode Int [Int] Type1 Type2 >> >> (Type1 and Type2 are nullary algebraic datatypes--enumerations in other >> words) >> >> How can I "index" the Array with an instance of a Node. I think I need to >> make Node an instance of Ix somehow?? >> > > What do the 'Int' and '[Int]' fields represent in your Node type? > > Antoine > >> Is this a sensible approach? Sample code of the instance declaration for Ix >> would be helpful. >> >> >> Thanks >> >> Mark Spezzano >> >> ___ >> 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] Diffs for hackage
On 14 August 2011 01:13, Joachim Breitner wrote: > But I think David is suggesting to adapt a similarly formatted changelog > file for Cabal packages, e.g. to display them on hackage. I am all for > that, as long as it does not prevent the introduction of changelogs > (e.g. by excessive bikeshedding or by having people lose interest > again). I think to an extent it might, as those people who already have changelogs of one kind or another would then have to go and re-format them (disclaimer: my changelog for graphviz is currently in Markdown so that I can make a web version of it: http://projects.haskell.org/graphviz/changelog.html ). -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Diffs for hackage
Hi, Am Samstag, den 13.08.2011, 12:57 +0200 schrieb Joachim Breitner: > Maybe it would already help to add a "changelog-file" field to .cabal, > just as with license-file, and reject packages on hackage that do not > have this field and file, and later decide if we need a more > standardized format for changelogs. here is a first step in improving the Haskell ecosystem with that regard: The patch attached to http://hackage.haskell.org/trac/hackage/ticket/873 makes "cabal check" remind the author that a changelog file is good practice (without fixing a name or format, or adding a field to the .cabal file). I hope it gets applied (hence CC’ing cabal-devel). Changing developers’ behavior by nudging tools is something that works great in Debian – if you want a change to get implemented across multiple packages, make sure lintian tells you about it. Hoping that people tend to run cabal check before uploading their package, they would now be reminded to include a changelog file. The next steps towards great changes documentation would then be: * Defining a changelog-file field in cabal. * Adding support to hackage to display the changelog. * Possibly define a suggested format for changelogs. Greetings, Joachim -- Joachim "nomeata" Breitner m...@joachim-breitner.de | nome...@debian.org | GPG: 0x4743206C xmpp: nome...@joachim-breitner.de | http://www.joachim-breitner.de/ signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Array and Ix for custom Graph ADT
On Sat, Aug 13, 2011 at 4:37 AM, Mark Spezzano wrote: > Hi, > > I'm creating a Graph data structure, and I want to use the array list > approach, implemented as an Array. > > I need my Nodes to be instances of Ix for this to work and my Node type is > roughly as follows: > > data Node = MyNode Int [Int] Type1 Type2 > > (Type1 and Type2 are nullary algebraic datatypes--enumerations in other words) > > How can I "index" the Array with an instance of a Node. I think I need to > make Node an instance of Ix somehow?? > What do the 'Int' and '[Int]' fields represent in your Node type? Antoine > Is this a sensible approach? Sample code of the instance declaration for Ix > would be helpful. > > > Thanks > > Mark Spezzano > > ___ > 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] Subtitles for "Programming in Haskell" videos
Hello. Are there subtitles (in English or Portuguese) for the video lectures[1] given by Erik Meijer using the book "Programming in Haskell", by Graham Hutton? [1] http://www.cs.nott.ac.uk/~gmh/book.html Romildo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANNOUNCE: taffybar: an alternative status bar for xmonad
I've wanted a slightly fancier status bar than xmobar for a while, so I finally made one. It uses gtk2hs and dbus extensively, so if you hate either of those things it probably isn't for you. Being written in gtk, though, it can have more graphical widgets. http://hackage.haskell.org/package/taffybar Current feature highlights: * It has a system tray * Generic graph widget for things like CPU/memory * XMonad log over DBus so it can be restarted independently of xmonad * Graphical battery widget There is still a lot that I want to add but I figured getting some feedback early would be handy. Documentation is currently at http://pages.cs.wisc.edu/~travitch/taffybar until I figure out how to appease Hackage (see the System.Taffybar module). signature.asc Description: Digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Diffs for hackage
On Sat, Aug 13, 2011 at 8:13 AM, Joachim Breitner wrote: > Hi, > > Am Sonntag, den 14.08.2011, 00:29 +1000 schrieb Ivan Lazar Miljenovic: >> On 14 August 2011 00:25, David Fox wrote: >> > Debian's packaging has a very strict changelog format where each entry >> > combines a log entry with the package name, the version number, the >> > author's name and email, and the date. This creates a very nice, >> > centralized, authoritative source for these pieces of information that >> > can't be accidentally omitted or allowed to become stale. >> >> Is this for the actual Debian packages, or even for source tarballs >> that they get from upstream? > > it’s for the packaging work, here is an example: > http://packages.debian.org/changelogs/pool/main/g/ghc/ghc_7.0.4-4/changelog > > But I think David is suggesting to adapt a similarly formatted changelog > file for Cabal packages, e.g. to display them on hackage. I am all for > that, as long as it does not prevent the introduction of changelogs > (e.g. by excessive bikeshedding or by having people lose interest > again). If anyone wants to take a look, there is a parser for Debian's changelog format in the debian package, module Debian.Changes: http://hackage.haskell.org/package/debian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Diffs for hackage
Hi, Am Sonntag, den 14.08.2011, 00:29 +1000 schrieb Ivan Lazar Miljenovic: > On 14 August 2011 00:25, David Fox wrote: > > Debian's packaging has a very strict changelog format where each entry > > combines a log entry with the package name, the version number, the > > author's name and email, and the date. This creates a very nice, > > centralized, authoritative source for these pieces of information that > > can't be accidentally omitted or allowed to become stale. > > Is this for the actual Debian packages, or even for source tarballs > that they get from upstream? it’s for the packaging work, here is an example: http://packages.debian.org/changelogs/pool/main/g/ghc/ghc_7.0.4-4/changelog But I think David is suggesting to adapt a similarly formatted changelog file for Cabal packages, e.g. to display them on hackage. I am all for that, as long as it does not prevent the introduction of changelogs (e.g. by excessive bikeshedding or by having people lose interest again). Greetings, Joachim -- Joachim "nomeata" Breitner m...@joachim-breitner.de | nome...@debian.org | GPG: 0x4743206C xmpp: nome...@joachim-breitner.de | http://www.joachim-breitner.de/ signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ML Workshop: register early by August 15
ACM SIGPLAN Workshop on ML Sunday, 18 September 2011, Tokyo, Japan (co-located with ICFP) http://conway.rutgers.edu/ml2011/ CALL FOR PARTICIPATION * Early Registration deadline is August 15! * The ML family of programming languages includes dialects known as Standard ML, Objective Caml, and F#. These languages have inspired a large amount of computer-science research, both practical and theoretical. This workshop aims to provide a forum for discussion and research on ML and related technology (higher-order, typed, or strict languages). The format of ML 2011 will continue the return in 2010 to a more informal model: a workshop with presentations selected from submitted abstracts. Presenters will be invited to submit working notes, source code, and extended papers for distribution to the attendees, but the workshop will not publish proceedings, so any contributions may be submitted for publication elsewhere. We hope that this format will encourage the presentation of exciting (if unpolished) research and deliver a lively workshop atmosphere. INVITED SPEAKERS Naoki Kobayashi (Tohoku University) Atsushi Ohori (Tohoku University) ACCEPTED TALKS Efficiently scrapping boilerplate code in OCaml Dmitri Boulytchev, Sergey Mechtaev Implementing implicit self-adjusting computation (short talk) Yan Chen, Joshua Dunfield, Matthew A. Hammer, Umut A. Acar Lightweight typed customizable unmarshaling Pascal Cuoq, Damien Doligez, Julien Signoles Adding GADTs to OCaml: the direct approach Jacques Garrigue, Jacques Le Normand A demo of Coco: a compiler of monadic coercions in ML (short talk) Nataliya Guts, Michael Hicks, Nikhil Swamy, Daan Leijen Verifying liveness properties of ML programs M. M. Lester, R. P. Neatherway, C.-H. L. Ong, S. J. Ramsay MixML remixed Andreas Rossberg, Derek Dreyer Report on OCaml type debugger Kanae Tsushima, Kenichi Asai Camomile: a Unicode library for OCaml (short talk) Yoriyuki Yamagata PROGRAM COMMITTEE Amal Ahmed (Indiana University) Andrew Tolmach (Portland State University) Anil Madhavapeddy (University of Cambridge) Chung-chieh Shan (chair) Joshua Dunfield (Max Planck Institute for Software Systems) Julia Lawall (University of Copenhagen) Keisuke Nakano (University of Electro-Communications) Martin Elsman (SimCorp) Walid Taha (Halmstad University) STEERING COMMITTEE Eijiro Sumii (chair) (Tohoku University) Andreas Rossberg (Google) Jacques Garrigue (Nagoya University) Matthew Fluet (Rochester Institute of Technology) Robert Harper (Carnegie Mellon University) Yaron Minsky (Jane Street) signature.asc Description: Digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Diffs for hackage
On 14 August 2011 00:25, David Fox wrote: > > Debian's packaging has a very strict changelog format where each entry > combines a log entry with the package name, the version number, the > author's name and email, and the date. This creates a very nice, > centralized, authoritative source for these pieces of information that > can't be accidentally omitted or allowed to become stale. Is this for the actual Debian packages, or even for source tarballs that they get from upstream? -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Diffs for hackage
On Sat, Aug 13, 2011 at 5:18 AM, Ivan Lazar Miljenovic wrote: > On 13 August 2011 20:57, Joachim Breitner wrote: >> Maybe it would already help to add a "changelog-file" field to .cabal, >> just as with license-file, and reject packages on hackage that do not >> have this field and file, and later decide if we need a more >> standardized format for changelogs. > > I agree, but it would be nice to also have optional readme-file, > todo-file and doc-files fields (the latter to let us avoid banging > documentation in with "extra-source-files"). > > As for a standardised format... I'm not sure if we need to enforce a > particular format, as long as it's understandable. Debian's packaging has a very strict changelog format where each entry combines a log entry with the package name, the version number, the author's name and email, and the date. This creates a very nice, centralized, authoritative source for these pieces of information that can't be accidentally omitted or allowed to become stale. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Diffs for hackage
On 13 August 2011 20:57, Joachim Breitner wrote: > Maybe it would already help to add a "changelog-file" field to .cabal, > just as with license-file, and reject packages on hackage that do not > have this field and file, and later decide if we need a more > standardized format for changelogs. I agree, but it would be nice to also have optional readme-file, todo-file and doc-files fields (the latter to let us avoid banging documentation in with "extra-source-files"). As for a standardised format... I'm not sure if we need to enforce a particular format, as long as it's understandable. -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Haskell Actors, Linda, publish / subscribe models?
Hi, I am trying to figure out what Haskell libraries can be used to build publish / subscribe communication between threads running both in the same and different address spaces on the net. For my needs any of these models will work: - Actors [ http://en.wikipedia.org/wiki/Actor_model ] - Linda tuple space [ http://en.wikipedia.org/wiki/Linda_%28coordination_language%29 ] - Publish / subscribe [ http://en.wikipedia.org/wiki/Java_Message_Service#Publish.2Fsubscribe_model] I need to build a framework to coordinate task producers / consumers distributed in the same and different address spaces. I need to scale a data processing application somewhat Hadoop-like way yet in more flexible manner, without Hadoop-specific distributed FS constraints. Looking through Applications and libraries/Concurrency and parallelism: http://www.haskell.org/haskellwiki/Applications_and_libraries/Concurrency_and_parallelism I found Haskell actor package [ http://hackage.haskell.org/cgi-bin/hackage-scripts/package/actor ] that fails to build with ghc 7.0. Please advise on latest working libraries. Thanks! -- All the best, Dmitri O. Kondratiev "This is what keeps me going: discovery" doko...@gmail.com http://sites.google.com/site/dokondr/welcome ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Diffs for hackage
Hi, Am Samstag, den 13.08.2011, 08:11 +0200 schrieb Luite Stegeman: > often when a new version of a package is available on hackage, I want > to see what has changed since the previous release. Unfortunately many > packages don't have a changelog this is something that should be changed! Reviewing code changes to see what has changed may be ok if you upgrade one library that you are going to use the library extensively. But for Distribution packagers (and surely other use cases), it is just too much. See http://hackage.haskell.org/trac/hackage/ticket/299 for more discussion, but please, avoid overengineering and rather get us changelogs soon. Maybe it would already help to add a "changelog-file" field to .cabal, just as with license-file, and reject packages on hackage that do not have this field and file, and later decide if we need a more standardized format for changelogs. Greetings, Joachim (Who is constantly annoyed and ashamed about this blemish of the Haskell ecosystem.) -- Joachim "nomeata" Breitner m...@joachim-breitner.de | nome...@debian.org | GPG: 0x4743206C xmpp: nome...@joachim-breitner.de | http://www.joachim-breitner.de/ signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Array and Ix for custom Graph ADT
Hi, I'm creating a Graph data structure, and I want to use the array list approach, implemented as an Array. I need my Nodes to be instances of Ix for this to work and my Node type is roughly as follows: data Node = MyNode Int [Int] Type1 Type2 (Type1 and Type2 are nullary algebraic datatypes--enumerations in other words) How can I "index" the Array with an instance of a Node. I think I need to make Node an instance of Ix somehow?? Is this a sensible approach? Sample code of the instance declaration for Ix would be helpful. Thanks Mark Spezzano ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Can I have a typeclass for topological spaces?
It may not be exactly what you want, but I played with https://github.com/luqui/topology-extras/blob/master/TopologyExtras/Topology.hs a few months ago, it may be a good basis to start with. (no pun intended) On Thu, Aug 11, 2011 at 5:08 PM, Grigory Sarnitskiy wrote: > Oh, I guess the class would look something like that: > > class TopologicalSpace a where >ifOpen :: (Subset a) -> Bool > > and Subset x is a type corresponding to subsets of x. > > 11.08.2011, 17:52, "Grigory Sarnitskiy" : > > Hello! I just wonder whether it is possible to have a typeclass for > topological spaces? > > > > ___ > > 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 > -- Alp Mestanogullari http://alpmestan.wordpress.com/ http://alp.developpez.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Diffs for hackage
Wow, really nice stuff. Great work! I'll find this very useful. On 13 August 2011 08:11, Luite Stegeman wrote: > hi all, > often when a new version of a package is available on hackage, I want to see > what has changed since the previous release. Unfortunately many packages > don't have a changelog or a public source code repository. That's why I have > made a simple website with git repositories that contain all versions of all > hackage packages: > > http://hdiff.luite.com/ > The home page contains a bookmarklet that takes you directly from the index > page of a package version (for > example http://hackage.haskell.org/package/parsec-3.1.0 ) to the commit > diff, showing the difference with the previous version > ( http://hdiff.luite.com/cgit/parsec/commit?id=3.1.0 ) > I hope some people will find this useful, > luite > > ___ > 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] type-class inference
On 13 August 2011 17:34, Patrick Browne wrote: > The :info command is a great help. > Why does > :info g 4 > produce a parse error, while > :t g 4 > does not? From :help in ghci: :info [ ...] display information about the given names By "names", it's referring to existing definitions, either in imported modules or defined within ghci using let, e.g.: Prelude> let foo = "foo" Prelude> :i foo foo :: [Char] -- Defined at :1:5-7 So, ":info g" would work; as would ":info g T" (by getting the info of both g and T _separately_).. But ":info g 4" doesn't because of the _4_, as it is a literal value, not a name of a value. This also happens with literal Strings, etc. Doing ":t g 4" tells ghci to determine the type of the expression "(g 4)". Note that even if you did ":info g T" it will _not_ give you the info of the expression "(g T)". -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] type-class inference
The :info command is a great help. Why does :info g 4 produce a parse error, while :t g 4 does not? Thanks for all your help, Pat On 13/08/2011 00:08, Brandon Allbery wrote: > Typeclasses are not independent of types, and are not inferred > separately from types. If you want to know what typeclasses a type is a > member of, use :info. On 12/08/2011 23:52, Patrick Browne wrote: >> Hi, >> Why does the Haskell :type command only sometimes print the type-class? >> Should I expect type-class inference as well as type inference? >> Maybe the type-class is inferred where possible, but not always printed? >> >> Thanks, >> Pat >> >> >> -- Code >> k x = x + 3 >> >> data T = T >> class A a where >> g::a -> a >> g a = a >> instance A T where >> instance A Integer where >> >> -- The results from the above code. >> -- First in the case of a function. Inferred the Num class >> *Main> :t k >> k :: forall a. (Num a) => a -> a >> *Main> :t k 3 >> k 3 :: forall t. (Num t) => t >> -- Did not print type class >> *Main> :t k (3::Integer) >> k (3::Integer) :: Integer >> >> -- Second in the case of a method of a type class. >> -- Inferred Num >> *Main> :t g 3 >> g 3 :: forall t. (A t, Num t) => t >> -- Did not print class A. >> *Main> :t g T >> g T :: T >> -- Did not print any class. >> *Main> :t g (3::Integer) >> g (3::Integer) :: Integer >> This message has been scanned for content and viruses by the DIT Information Services E-Mail Scanning Service, and is believed to be clean. http://www.dit.ie ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe