Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Tom Ellis
On Mon, Jul 01, 2013 at 05:18:39PM +1200, Richard A. O'Keefe wrote: > On 1/07/2013, at 1:04 PM, Richard Cobbe wrote: > > I should have been clearer in my original question: I'm curious about what > > to do when a multi-argument function application gets split across lines. > > That wiki page dicsus

Re: [Haskell-cafe] question automatic indentation (and so on)

2013-07-01 Thread Joachim Breitner
Hi, on a related note: At HaL8 I was wondering how well Haskell would be suited for a workflow similar to what the go programmers do: Do not worry about code layout, but let the computer handle it! For more rationale and examples see http://golang.org/doc/effective_go.html#formatting While everyo

[Haskell-cafe] Installing Z3 on OS X 10.8.4 ( Off topic )

2013-07-01 Thread mukesh tiwari
Hello all, Not directly related to Haskell but I am trying to install Z3 to use SBV package[1]. I followed the instructions[2] to install it. *Mukeshs-MacBook-Pro:SMT mukeshtiwari$ git clone https://git01.codeplex.com/z3 -b unstable Cloning into 'z3'... remote: Counting objects: 16070, done. rem

Re: [Haskell-cafe] Installing Z3 on OS X 10.8.4 ( Off topic )

2013-07-01 Thread mukesh tiwari
I also tried installing Yices[1] but still getting same error. I followed the instructions but still the same error. Seems like I am missing some crucial details about path but not able to resolve it. Mukeshs-MacBook-Pro:SMT mukeshtiwari$ cd yices-2.1.0/ Mukeshs-MacBook-Pro:yices-2.1.0 mukeshtiwa

Re: [Haskell-cafe] Installing Z3 on OS X 10.8.4 ( Off topic )

2013-07-01 Thread mukesh tiwari
Finally I got the Yices working by adding yices-2.1.0/bin to my path. Still looking to resolve Z3. Regards, Mukesh Tiwari On Mon, Jul 1, 2013 at 3:42 PM, mukesh tiwari wrote: > I also tried installing Yices[1] but still getting same error. I followed > the instructions but still the same error

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Johannes Waldmann
> Code which is part of some expression should be indented > further in than the beginning of that expression [...] Yes. Then the next question is "how much further in". My answer is: it does not matter, but make it consistent (like 4 spaces), with the implication that indentation sh

Re: [Haskell-cafe] question automatic indentation (and so on)

2013-07-01 Thread Richard Cobbe
On Mon, Jul 01, 2013 at 09:48:42AM +0200, Joachim Breitner wrote: > I found https://github.com/jaspervdj/stylish-haskell/ (found via > http://stackoverflow.com/q/6870148/946226) which formats just some very > few aspects of Haskell. Does anyone have a more complete solution? Or is > interested i

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Richard Cobbe
On Mon, Jul 01, 2013 at 05:18:39PM +1200, Richard A. O'Keefe wrote: > > It looked pretty explicit to me: > > The golden rule of indentation > ... > you will do fairly well if you just remember a single rule: > Code which is part of some expression should be indented >

Re: [Haskell-cafe] Installing Z3 on OS X 10.8.4 ( Off topic )

2013-07-01 Thread Johannes Waldmann
> Unable to locate executable for z3 well, do you really have z3 in the $PATH? what does 'which z3' answer? I used this for installation of z3: python scripts/mk_make.py --prefix=/usr/local and note that the install script says: Z3 shared libraries were installed at /usr/local/lib, make sure

Re: [Haskell-cafe] question automatic indentation (and so on)

2013-07-01 Thread Joachim Breitner
Hi, Am Montag, den 01.07.2013, 07:59 -0400 schrieb Richard Cobbe: > How does the indentation tool know if (a b c) is supposed to be the next > item in the do block, or merely a continuation of the previous application > of f? I would still expect the developer to write correctly intended Haskell,

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Sturdy, Ian
I always preferred (I think going back to my lisp days) foo x y z indenting subsequent arguments to the same level as the first, but I have not convinced haskell-mode to do that for me. (The general rule here being that similar things should be at the same indent, which will alway

Re: [Haskell-cafe] Installing Z3 on OS X 10.8.4 ( Off topic )

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 8:34 AM, Johannes Waldmann < waldm...@imn.htwk-leipzig.de> wrote: > and note that the install script says: > > Z3 shared libraries were installed at /usr/local/lib, make sure this > directory is in your LD_LIBRARY_PATH environment variable. > Only applicable on Linux (and s

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 3:43 AM, Tom Ellis < tom-lists-haskell-cafe-2...@jaguarpaw.co.uk> wrote: > > is OK but > > f (g x > > y z) > > is not. > > It seems to me that this means > > f x1 x2 > x3 x4 > > is not. The OP was initially asking about this situation. > If you wrote th

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Tikhon Jelvis
My current approach is not to have one rule for every case but rather to indent however seems best for the particular code. For example, for Parsec's <|>, I try to make the code look like a BNF grammar rather than adhering to normal indentation conventions. Perhaps as a carry-over from my C-style p

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 9:56 AM, Tikhon Jelvis wrote: > I've thought about writing an automatic indenting tool for Haskell (or, > more accurately, a pretty-printer) for another project I have, and this is > the main thing that threw me off. While automatic indentation might make > sense for less e

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Tikhon Jelvis
That's certainly true. As I mentioned, I was actually considering a *pretty-printer* rather than an automatic indentation tool per se. The end results are similar, but the pretty-printer is really only the latter part of the problem: it's predicated on already having a valid AST. My particular use

Re: [Haskell-cafe] Installing Z3 on OS X 10.8.4 ( Off topic )

2013-07-01 Thread Levent Erkok
SBV should be able to pick up Z3 from your path; make sure the "z3" executable is in it and you can invoke it from your shell. Alternatively, you can use the SBV_Z3 environment variable to point to the executable itself, if adding it to your path is not desirable for whatever reason. Let me know i

[Haskell-cafe] "Casting" newtype to base type?

2013-07-01 Thread Vlatko Basic
Hello Cafe! I had a (simplified) record data P = P { a :: String, b :: String, c :: IO String } deriving (Show, Eq) but to get automatic deriving of 'Show' and 'Eq' for 'data P' I have created 'newtype IOS' and its 'Show' and 'Eq' instances newtype IOS = IO String insta

Re: [Haskell-cafe] "Casting" newtype to base type?

2013-07-01 Thread Frerich Raabe
Am 7/1/2013 5:07 PM, schrieb Vlatko Basic: to get automatic deriving of 'Show' and 'Eq' for 'data P' I have created 'newtype IOS' and its 'Show' and 'Eq' instances newtype IOS = IO String What you really want is newtype IOS = IOS (IO String) I.e. a IOS value "wraps" an IO String. d

Re: [Haskell-cafe] "Casting" newtype to base type?

2013-07-01 Thread Tom Ellis
On Mon, Jul 01, 2013 at 05:07:00PM +0200, Vlatko Basic wrote: > Hello Cafe! > > I had a (simplified) record > > data P = P { > a :: String, > b :: String, > c :: IO String > } deriving (Show, Eq) > > but to get automatic deriving of 'Show' and 'Eq' for 'data P' I have > created

Re: [Haskell-cafe] Spam on list??

2013-07-01 Thread Tom Ellis
Yeah I'm getting stuff from j...@eukor.com every time I post. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] "Casting" newtype to base type?

2013-07-01 Thread Malcolm Wallace
On 1 Jul 2013, at 16:07, Vlatko Basic wrote: > I had a (simplified) record > > data P = P { >a :: String, >b :: String, >c :: IO String >} deriving (Show, Eq) > > but to get automatic deriving of 'Show' and 'Eq' for 'data P' I have created > 'newtype IOS' and its 'Show' and 'E

[Haskell-cafe] Spam on list??

2013-07-01 Thread Vlatko Basic
Title: 인증페이지시안1 Anybody else getting this spam emails from j...@eukor.com every time a message is sent to Cafe? Original Message Subject: Re: [Haskell-cafe] "Casting" newtype to base type? From: j...@eukor.com To: m

Re: [Haskell-cafe] Spam on list??

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 11:19 AM, Vlatko Basic wrote: > Anybody else getting this spam emails from j...@eukor.com every time a > message is sent to Cafe? > Yes, and I'm hoping a list admin steps in soon. The irony is, it's their *anti*spam filter. They decided to use one of those obnoxious white

Re: [Haskell-cafe] Subclass or no subclass?

2013-07-01 Thread Patrick Browne
On 30/06/13, Dan Burton wrote:I am not trying to say "every building is a shelter", rather "anything that is a building must provide sheltering services". Well if it walks like a shelter and quacks like a shelter... /shrugOne of the nice things about OO is the intuitive nature of the is-a relati

Re: [Haskell-cafe] Subclass or no subclass?

2013-07-01 Thread Darren Grant
Here's another thought (not my own): Abstractions can be classified based on where responsibility lies. Popular languages implementing interface composition expect the caller to know almost nothing about the concrete details while the callee has to handle all concrete permutations. Conversely, the

Re: [Haskell-cafe] "Casting" newtype to base type?

2013-07-01 Thread Vlatko Basic
Hi Wallace, yes, indeed. Now I see I mixed newtype with type in declaration, and forgot the first one is a constructor. Original Message Subject: Re: [Haskell-cafe] "Casting" newtype to base type? From: Malcolm Wallace To: vlatko.ba...@gmail.com Cc: Haskell-Cafe Date: 01.

Re: [Haskell-cafe] "Casting" newtype to base type?

2013-07-01 Thread Vlatko Basic
I'm experimenting. The IO field is just a helper field, so it shouldn't have any consequences. Original Message Subject: Re: [Haskell-cafe] "Casting" newtype to base type? From: Tom Ellis To: haskell-cafe@haskell.org Date: 01.07.2013 17:24 On Mon, Jul 01, 2013 at 05:07:00P

Re: [Haskell-cafe] ANNOUNCE: module-management-0.9.3 - clean import lists, split and merge modules

2013-07-01 Thread David Fox
On Sat, Jun 29, 2013 at 12:09 PM, David Fox wrote: > I've just uploaded version 0.10, which corrects some formatting bugs > and incorporates most of the changes suggested in this thread. Please > give it a try! Version 0.10.1 is now available - it should build with GHC 7.4.1, fixes more formatti

Re: [Haskell-cafe] ANNOUNCE: module-management-0.9.3 - clean import lists, split and merge modules

2013-07-01 Thread Oliver Charles
On 07/01/2013 08:38 PM, David Fox wrote: > Should I keep posting updates in this thread? Yes please, I'm interested in following this development! That, or get yourself a blog and let us all know where to point our RSS readers. - Ollie signature.asc Description: OpenPGP digital signature

[Haskell-cafe] cabal-dev: installing/running with profiling enabled

2013-07-01 Thread Ömer Sinan Ağacan
Hi all, I want to profile a Haskell program. I have tons of libraries installed without profiling enabled, and some of them are installed with my Linux distribution's package mangaer. So I tried installing the program in a fresh cabal-dev environment with profiling enabled, so that all dependenci

Re: [Haskell-cafe] some questions about Template Haskell

2013-07-01 Thread TP
John Lato wrote: > The problem isn't the output of nameBase, it's the input parameter 'n'. > In your example, you've created a function that takes input (a Name) and > generates code based upon that input. In order to lift a value (n) from > an ordinary context into a quote, it needs a Lift inst

Re: [Haskell-cafe] cabal-dev: installing/running with profiling enabled

2013-07-01 Thread Rogan Creswick
Hi Ömer, I've replied in-line below. On Mon, Jul 1, 2013 at 2:34 PM, Ömer Sinan Ağacan wrote: > So I tried installing the program in a fresh cabal-dev environment > with profiling enabled, so that all dependencies would be also > installed with profiling enabled. But for some reason even after >

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Richard A. O'Keefe
On 2/07/2013, at 12:00 AM, Richard Cobbe wrote: > Sure. So my first question boils down to which of the two alternatives > below does the community prefer? (To be clear about the intended > semantics: this is the application of the function f to the arguments x, y, > and z.) > >f x >y

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Richard Cobbe
On Sun, Jun 30, 2013 at 07:53:08PM -0400, Richard Cobbe wrote: > Two questions: And what I've concluded by reading this thread: > 1) Are there wide-spread conventions in the Haskell community for how to > indent an application expression that's split across multiple lines? Well, there's general

Re: [Haskell-cafe] some questions about Template Haskell

2013-07-01 Thread adam vogt
On Mon, Jul 1, 2013 at 5:42 PM, TP wrote: > So what is the difference between lift and [||]? > Although I feel stupid, I cannot lie and claim I have understood. Hi TP, Sometimes [| |] does need to call lift. If for some reason the original lift wasn't exported, you could define: myLift x = [| x

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Patrick Mylund Nielsen
I prefer the other style--as do others, evidently (see the example in my first reply.) I agree that this was a good discussion, but let's not conclude so easily that the entire community is in favor of one thing or the other. On Mon, Jul 1, 2013 at 8:24 PM, Richard Cobbe wrote: > On Sun, Jun 30

Re: [Haskell-cafe] cabal-dev: installing/running with profiling enabled

2013-07-01 Thread Ömer Sinan Ağacan
Hi Rogan, Thanks for your reply. > I don'th think the -prof flag is necessary; but if it is, then it may also > be misinterpreted by cabal-dev; generally, you need to pass flags that only > use a single leading "-" to cabal-dev with the --flags=... option. (eg: > 'cabal-dev install --enable-libra

Re: [Haskell-cafe] Installing Z3 on OS X 10.8.4 ( Off topic )

2013-07-01 Thread mukesh tiwari
Thank you for your response. Now it's working. -Mukesh Tiwari On Mon, Jul 1, 2013 at 8:32 PM, Levent Erkok wrote: > SBV should be able to pick up Z3 from your path; make sure the "z3" > executable is in it and you can invoke it from your shell. Alternatively, > you can use the SBV_Z3 environme