Re: [Haskell-cafe] Poor first impression
On 29/04/07, Derek Elkins [EMAIL PROTECTED] wrote: Much quicker than waiting for a configure script to detect the problem. The fact remains that there is a bug in the build process (configure doesn't check for all the dependencies), and that users have fallen afoul of the bug, so it should be fixed, no matter how well the workaround is documented. -- -David House, [EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Displaying infered type signature of 'offside' functions
On 28/04/07, Georg Sauthoff [EMAIL PROTECTED] wrote: Well, I mention this, because I would like to integrate some lookup feature (for type signatures) into vim (if it doesn't exist yet). It's worth pointing out that Emacs's haskell-mode already has this. For anyone that uses the major mode but hasn't heard of the inf-haskell features: C-c C-t inferior-haskell-type: looks up a type of the function under point, built-in or user-defined. C-c C-i inferior-haskell-info: looks up the info, à la GHCi :info, of the identifer under point, built-in or user-defined. C-c M-. inferor-haskell-find-definition: jumps to the definition of the function, class or datatype etc. under point. See the Haskell wiki page [1] for more information. [1]: http://haskell.org/haskellwiki/Haskell_mode_for_Emacs#inf-haskell.el:_the_best_thing_since_the_breadknife -- -David House, [EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Displaying infered type signature of 'offside' functions
On 29/04/07, David House [EMAIL PROTECTED] wrote: It's worth pointing out that Emacs's haskell-mode already has this. For anyone that uses the major mode but hasn't heard of the inf-haskell features: I did forget to mention that this won't help with your 'offside' functions, though. -- -David House, [EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Poor first impression
On 4/29/07, David House [EMAIL PROTECTED] wrote: The fact remains that there is a bug in the build process (configure doesn't check for all the dependencies), and that users have fallen afoul of the bug, so it should be fixed, no matter how well the workaround is documented. -- -David House, [EMAIL PROTECTED] That was my point. Applause. ;) FC -- Dream of the Daily Mail It is the Holy Grail And then the BBC Your life would be complete -Manic Street Preachers, Royal Correspondent ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Displaying infered type signature of 'offside'functions
On 28/04/07, Georg Sauthoff [EMAIL PROTECTED] wrote: Well, I mention this, because I would like to integrate some lookup feature (for type signatures) into vim (if it doesn't exist yet). It's worth pointing out that Emacs's haskell-mode already has this. as do many Vim Haskell modes. for instance, in my own, there are _t : show type for id under cursor _T : add type declaration for id under cursor before current line _si : show info for id under cursor CTRL-] : jump to definition of id under cursor '_t' and '_T' use (cached) output from GHCi :browse for the current and imported modules, '_si' calls GHCi :info, CTRL-] uses the tags file generated by 'ghc -e :ctags current' (which is mapped to '_ct'). see http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/ for more info, a tour, and the scripts. I did forget to mention that this won't help with your 'offside' functions, though. that, indeed, is the point. if it is reasonably easy to get that information, without internal identifiers or non-source constructs, and with correct associations to source code positions, it would be a useful addition to editor bindings. it would perhaps be nice to have a wiki page collecting Haskell IDE features that have been implemented in at least one of the many tools, so that everybody can try to implement a similar feature set for their own editor/ide? there are features that depend on individual preferences, such as indentation, and there are obvious features that everybody wants, such as those above, but often, someone somewhere hacks up a little trick that makes Haskell hacking life a lot easier. here is a near trivial example from my vimrc file (not even Haskell- specific): map ,{ c{}escP% map ,( c()escP% map ,[ c[]escP% this allows me to insert parens by highlighting the part to be enclosed (*). similarly, the emacs modes have a command to align patterns in the middle of adjacent lines, such as '=', '::', which is different from indent, and sounds potentially quite useful, to align multiple equations and their type declaration, so i've started to reproduce that for vim. claus (*) ',(' is mapped to: replace (c) highlighted, insert '()', escape to command mode (esc), paste cut buffer before current pos (P), jump to matching paren (%). so i just highlight an expr and hit ',(' to put it in parens, or ',[' to wrap it into a list, etc. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] PartitionBy (was: Behavior groupBy)
Hello All, As usual, my first attempt could be better.. -- partitions a list according to an equivalence relation import Data.List (partition) partitionBy :: (a - a - Bool) - [a] - [[a]] partitionBy eq [] = [] partitionBy eq ls = x:(partitionBy eq y) where (x,y) = partition ((head ls) `eq`) ls example partitionBy (\x y - (last x) == (last y)) [abc,bd,bdc,abd] result [[abc,bdc],[bd,abd]] Of course, any crits would be appreciated, but maybe this will save somebody some time.. Thanks, Hans van Thiel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Creating pseudo terminals
How can I create a pseudo terminal in Linux with Haskell? Nothing is jumping out at me in the standard library. I haven't done this before in any language, so any tips would be appreciated. From what I gather, a call to posix_openpt or openpty returns a master and a slave, or alternatively opening /dev/ptmx followed by calls to grantpt and unlockpt. I'm building a load balancing and sharing system similar to Platform's LSF. The pseudo terminal is for interactive jobs running on a remote machine. Thanks for any help! -Tom ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Creating pseudo terminals
On 2007-04-29, Tom Hawkins [EMAIL PROTECTED] wrote: Hi, [..] I haven't done this before in any language, so any tips would be appreciated. From what I gather, a call to posix_openpt or openpty returns a master and a slave, or alternatively opening /dev/ptmx followed by calls to grantpt and unlockpt. well, then I suggest 'Stevens, Advanced programming in the unix environment' for basic pseudo terminal programming. Best regards Georg Sauthoff ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Displaying infered type signature of 'offside'functions
This looks like a good place to ask a question that's been bugging me for a bit: I've had cases in my own code where I can't seem to create a type annotation for an inner declaration that the type-checker likes. Here's a toy example: In the following code: applyfunc :: (a - b - c) - a - b - c applyfunc f x y = doit y where doit = f x What type annotation can I successfully apply to the function doit? Thanks, Antoine On 4/29/07, Claus Reinke [EMAIL PROTECTED] wrote: On 28/04/07, Georg Sauthoff [EMAIL PROTECTED] wrote: Well, I mention this, because I would like to integrate some lookup feature (for type signatures) into vim (if it doesn't exist yet). It's worth pointing out that Emacs's haskell-mode already has this. as do many Vim Haskell modes. for instance, in my own, there are _t : show type for id under cursor _T : add type declaration for id under cursor before current line _si : show info for id under cursor CTRL-] : jump to definition of id under cursor '_t' and '_T' use (cached) output from GHCi :browse for the current and imported modules, '_si' calls GHCi :info, CTRL-] uses the tags file generated by 'ghc -e :ctags current' (which is mapped to '_ct'). see http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/ for more info, a tour, and the scripts. I did forget to mention that this won't help with your 'offside' functions, though. that, indeed, is the point. if it is reasonably easy to get that information, without internal identifiers or non-source constructs, and with correct associations to source code positions, it would be a useful addition to editor bindings. it would perhaps be nice to have a wiki page collecting Haskell IDE features that have been implemented in at least one of the many tools, so that everybody can try to implement a similar feature set for their own editor/ide? there are features that depend on individual preferences, such as indentation, and there are obvious features that everybody wants, such as those above, but often, someone somewhere hacks up a little trick that makes Haskell hacking life a lot easier. here is a near trivial example from my vimrc file (not even Haskell- specific): map ,{ c{}escP% map ,( c()escP% map ,[ c[]escP% this allows me to insert parens by highlighting the part to be enclosed (*). similarly, the emacs modes have a command to align patterns in the middle of adjacent lines, such as '=', '::', which is different from indent, and sounds potentially quite useful, to align multiple equations and their type declaration, so i've started to reproduce that for vim. claus (*) ',(' is mapped to: replace (c) highlighted, insert '()', escape to command mode (esc), paste cut buffer before current pos (P), jump to matching paren (%). so i just highlight an expr and hit ',(' to put it in parens, or ',[' to wrap it into a list, etc. ___ 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] Displaying infered type signature of 'offside'functions
On Sun, Apr 29, 2007 at 07:03:32PM -0500, Antoine Latter wrote: This looks like a good place to ask a question that's been bugging me for a bit: I've had cases in my own code where I can't seem to create a type annotation for an inner declaration that the type-checker likes. Here's a toy example: In the following code: applyfunc :: (a - b - c) - a - b - c applyfunc f x y = doit y where doit = f x What type annotation can I successfully apply to the function doit? There isn't one, plain and simple. However, if you allow GHC extensions, you can: {-# Language ScopedTypeVariables #-} applyfunc :: forall a b c . (a - b - c) - a - b - c applyfunc f x y = doit y where doit :: b - c doit = f x The 'forall' serves no other purpose than to deliberately break haskell 98 compatibility. Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe