Re: [Haskell-cafe] First time haskell - parse error!
2010/3/9 boblettoj bobletto...@msn.com: Hi, i am getting an error when trying to compile this part of my program, its my first time using haskell and as lovely as it is it didn't give me very much to go on in the error message! codescore :: String - String - String score [s] [] = false score [s] [g] = if valid 4 g then (s1 ++ s2 ++ s3 ++ s4) where s1 = Golds s2 = show (gold s g) s3 = , Silvers s4 = show (silver s g) else Bad Guess/code when i try to compile it says: test.hs 63:29: parse error on input 'where' (its the line beginning with 'then') Anybody got any ideas whats going on? thanks! -- View this message in context: http://old.nabble.com/First-time-haskell---parse-error%21-tp27839657p27839657.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe You can't use `where' in the middle of an `if'. This should get rid of the parse error: score :: String - String - String score [s] [] = false score [s] [g] = if valid 4 g then (s1 ++ s2 ++ s3 ++ s4) else Bad Guess where s1 = Golds s2 = show (gold s g) s3 = , Silvers s4 = show (silver s g) -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] how to write a function to send a string to a tuple
2010/3/8 Pradeep Wickramanayake prad...@talk.lk: Hi, Im having problems with sending a string to a tuple. My string contains integers and strings The whole string stay as (“test,dfdf”,3,”dfsf”) sortList2 :: String - String sortList2 (x:xs) | x == ',' = | otherwise = [x] ++ sortList2 xs The above function separating each words from the string Now I need to put them to a tuple putList :: String - (Int, String, String, Int, Int) putList (x:xs) |xs /= = sortList2 ++ putList xs I'm not sure what you're doing with the sorting, but you could sort of hack it using `read' as such: Prelude read (3, \hello\) :: (Int, String) (3, hello) Of course, this will crash if the input string is not parsable. Prelude read (3, 'a') :: (Int, String) *** Exception: Prelude.read: no parse -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Quick, somebody do something!
2010/1/14 Henk-Jan van Tuyl hjgt...@chello.nl: Haskell has dropped out of the top 50 at Tiobe [1]; how could this hapen? Let's start selling mobile phones that can only be programmed in Haskell :-) [1] http://www.tiobe.com/content/paperinfo/tpci/index.html -- Met vriendelijke groet, Henk-Jan van Tuyl So then we lived up to Peyton-Jones' Haskell slogan: avoid success at all costs. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Why?
2009/12/10 Sebastian Sylvan sebastian.syl...@gmail.com: I think laziness requires purity to make sense. Laziness implies that the order of evaluation is highly unpredictable and depends strongly on the implementation details of libraries and such (which you may not have access to). So it's fickle. Someone adds an if statement somewhere and all of a sudden a variable gets evaluated earlier than it used to. It would be madness to write any code which depends on this unpredictable behaviour. In other words, the expressions that get evaluated lazily must not have side effects. -- Sebastian Sylvan +1 This unpredictability has bit me a few times when using LINQ (which is awesome and has lazy evaluation) with C#. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Allowing hyphens in identifiers
2009/12/9 Maciej Piechotka uzytkown...@gmail.com: On Tue, 2009-12-08 at 10:56 +0100, Deniz Dogan wrote: Has there been any serious suggestion or attempt to change the syntax of Haskell to allow hyphens in identifiers, much like in Lisp languages? E.g. hello-world would be a valid function name. You mean to parse a - b differently then a-b? You don't have the problem in LISP as AFAIR you use (- a b) but in Haskell it would be a problem. I understand. How do GHC extensions work? Would a (hopefully tiny) GHC extension make it possible to use normal hyphens (i.e. those in ASCII) in identifiers? If so, is anyone interested in writing one? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Allowing hyphens in identifiers
2009/12/9 Richard O'Keefe o...@cs.otago.ac.nz: On Dec 9, 2009, at 10:54 PM, Maciej Piechotka wrote: You mean to parse a - b differently then a-b? You don't have the problem in LISP as AFAIR you use (- a b) but in Haskell it would be a problem. It's a problem that COBOL solved a long time ago: COMPUTE INCREASED-DEBT = TOTAL-EXPENSES - AFTER-TAX-INCOME. Haskell already has this problem with ., where we generally need to put spaces around . with the meaning composition and not put spaces around other uses. This is something someone could easily try out by writing a trivial preprocessor to convert hyphens with letters on each side to underscores. See how it works. Given the amazinglyUglyAndUnreadably baStudlyCaps namingStyle that went into Haskell forNoApparentReasonThatIHaveEverHeardOf, it might be nice to have a wee preprocessor that turned lower case letter one _ lower case letter two into lower case letter one Upper case letter two so that I could write take_while and Haskell could see takeWhile. [I'm writing this in MacOS X Mail. takeWhile is underlined in red as a spelling mistake, take_while is not. Maybe they know something...] Here is such a preprocessor. This is meant for people to try out. I don't claim that it's perfect, it's just a quick hack. Is there any flag I can pass to e.g. GHC to make it use the preprocessor automagically or do I write my own little hack to apply the preprocessor? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Allowing hyphens in identifiers
Has there been any serious suggestion or attempt to change the syntax of Haskell to allow hyphens in identifiers, much like in Lisp languages? E.g. hello-world would be a valid function name. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Allowing hyphens in identifiers
2009/12/8 Jon Fairbairn jon.fairba...@cl.cam.ac.uk: Deniz Dogan deniz.a.m.do...@gmail.com writes: Has there been any serious suggestion or attempt to change the syntax of Haskell to allow hyphens in identifiers, much like in Lisp languages? E.g. hello-world would be a valid function name. I (among others) suggested it right at the beginning when we were first defining the lexical syntax, and have raised the possibility again a couple of times now that unicode hyphens are available, but it wasn't liked at the beginning and hasn't excited much interest since. Why do you want them? I just like the standard Lisp naming convention better than camel casing and saw someone on #haskell mentioning it the other day. No biggie though. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell] Re: [Haskell-cafe] The Haskell Web News: December 2009 Edition
2009/12/7 Don Stewart d...@galois.com: The Haskell Web News is a monthly summary of the hottest news about the Haskell programming language, as found in our online communities. If you want to catch up with what’s been happening in Haskell, this might be the journal for you. http://haskellwebnews.wordpress.com/2009/12/05/whats-new-in-haskell-december-2009/ What’s been happening with the Haskell programming language for the past month, as voted by readers of The Haskell Reddit. This is the first edition of the Web News, so feedback on the content, schedule and goals is welcome. -- Don ___ Haskell-Cafe mailing list haskell-c...@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe I think the correct URL should be: http://haskellwebnews.wordpress.com/2009/12/05/whats-new-in-haskell-december-2009/ Yours didn't work for me. -- Deniz Dogan ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
[Haskell] Re: [Haskell-cafe] The Haskell Web News: December 2009 Edition
2009/12/7 Tom Tobin korp...@korpios.com: On Mon, Dec 7, 2009 at 11:25 AM, Deniz Dogan deniz.a.m.do...@gmail.com wrote: 2009/12/7 Don Stewart d...@galois.com: The Haskell Web News is a monthly summary of the hottest news about the Haskell programming language, as found in our online communities. If you want to catch up with what’s been happening in Haskell, this might be the journal for you. http://haskellwebnews.wordpress.com/2009/12/05/whats-new-in-haskell-december-2009/ I think the correct URL should be: http://haskellwebnews.wordpress.com/2009/12/05/whats-new-in-haskell-december-2009/ Actually, I think it's: http://haskellwebnews.wordpress.com/2009/12/06/whats-new-in-haskell-december-2009/ ___ Haskell-Cafe mailing list haskell-c...@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Of course, that's what I meant. :) -- Deniz Dogan ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: [Haskell-cafe] The Haskell Web News: December 2009 Edition
2009/12/7 Don Stewart d...@galois.com: The Haskell Web News is a monthly summary of the hottest news about the Haskell programming language, as found in our online communities. If you want to catch up with what’s been happening in Haskell, this might be the journal for you. http://haskellwebnews.wordpress.com/2009/12/05/whats-new-in-haskell-december-2009/ What’s been happening with the Haskell programming language for the past month, as voted by readers of The Haskell Reddit. This is the first edition of the Web News, so feedback on the content, schedule and goals is welcome. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe I think the correct URL should be: http://haskellwebnews.wordpress.com/2009/12/05/whats-new-in-haskell-december-2009/ Yours didn't work for me. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] The Haskell Web News: December 2009 Edition
2009/12/7 Tom Tobin korp...@korpios.com: On Mon, Dec 7, 2009 at 11:25 AM, Deniz Dogan deniz.a.m.do...@gmail.com wrote: 2009/12/7 Don Stewart d...@galois.com: The Haskell Web News is a monthly summary of the hottest news about the Haskell programming language, as found in our online communities. If you want to catch up with what’s been happening in Haskell, this might be the journal for you. http://haskellwebnews.wordpress.com/2009/12/05/whats-new-in-haskell-december-2009/ I think the correct URL should be: http://haskellwebnews.wordpress.com/2009/12/05/whats-new-in-haskell-december-2009/ Actually, I think it's: http://haskellwebnews.wordpress.com/2009/12/06/whats-new-in-haskell-december-2009/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Of course, that's what I meant. :) -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wikipedia article
2009/12/4 Simon Marlow marlo...@gmail.com: As noted before, the Wikipedia article for Haskell is a disorganised mess. http://en.wikipedia.org/wiki/Haskell_%28programming_language%29 earlier this year, dons suggested reorganising it and posted a template on the Haskell wiki: http://haskell.org/haskellwiki/WikipediaArticleDesign I've made a start on a new version of the page: http://en.wikipedia.org/wiki/User:Simonmar/Haskell_%28programming_language%29 I've kept most of the existing information, but reorganised it more or less according to Don's template, and I filled out the overview section. Also I fixed numerous things, but the page still has a long way to go Does anyone mind if I spam the existing Haskell article with this new one, or do people think we should continue editing the sandbox version until it's in better shape? Cheers, Simon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Could someone please do something about the horrible syntax highlighting for strings in the Wikipedia article? Black on dark green, really? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wiki software?
2009/11/18 Günther Schmidt gue.schm...@web.de: Hi, I'm finally about to organize myself, somewhat. And am going to use a wiki for it. Does there a good one exist that's written in Haskell? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Not what you were looking for, but org-mode in Emacs is great for organizing stuff. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] About xmonad
2009/11/16 zaxis z_a...@163.com: %uname -a Linux myarch 2.6.31-ARCH #1 SMP PREEMPT Tue Nov 10 19:48:17 CET 2009 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 3600+ AuthenticAMD GNU/Linux %xmonad --version xmonad 0.9 In firefox, the `save as` dialog doesnot appear when i want to choose picture to save by right clicking the mouse. %cat ~/.xmonad/xmonad.hs import XMonad import XMonad.Hooks.ManageDocks import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageHelpers import XMonad.Util.Run(spawnPipe) import XMonad.Layout.TwoPane import XMonad.Layout.WindowNavigation import qualified XMonad.StackSet as W import qualified Data.Map as M main = do xmonad $ defaultConfig { borderWidth = 1 , focusedBorderColor = #ff , normalBorderColor = #aa , manageHook = manageHook defaultConfig + myManageHook , workspaces = map show [1 .. 10 :: Int] , terminal = roxterm , modMask = mod4Mask , focusFollowsMouse = True , startupHook = myStartupHook , logHook = myLogHook , layoutHook = windowNavigation $ avoidStruts $ (Mirror tall ||| tall ||| Full) --, layoutHook = ewmhDesktopsLayout $ windowNavigation $ avoidStruts $ (Mirror tall ||| tall ||| Full) , keys = \c - myKeys c `M.union` keys defaultConfig c --, mouseBindings = \c - myMouse c `M.union` mouseBindings defaultConfig c } where tall = Tall 1 (3/100) (1/2) myStartupHook :: X () myStartupHook = do { spawn fcitx; spawn roxterm; spawn lxpanel; spawn /home/sw2wolf/bin/kvm.sh; } myLogHook :: X () myLogHook = ewmhDesktopsLogHook myManageHook :: ManageHook myManageHook = composeAll . concat $ [ [ className =? c -- doFloat | c - myCFloats] ,[ resource =? r -- doFloat | r - myRFloats] ,[ title =? t -- doFloat | t - myTFloats] ,[ className =? c -- doIgnore | c - ignores] ,[ className =? Audacious -- doShift 3 ] ,[ className =? Firefox -- doF W.swapDown] ,[(role =? gimp-toolbox || role =? gimp-image-window) -- (ask = doF . W.sink)]] where myCFloats = [Thunderbird-bin, GQview, MPlayer, Gimp,Vncviewer,Xmessage] myRFloats = [Dialog, Download, Places] myTFloats = [Firefox Preferences, Element Properties] ignores = [trayer] role = stringProperty WM_WINDOW_ROLE myKeys (XConfig {modMask = modm}) = M.fromList $ -- Apps and tools [ ((modm, xK_F2), spawn gmrun) , ((modm, xK_f), spawn /home/firefox/firefox) , ((modm, xK_t), spawn thunderbird) --, ((modm, xK_p), spawn exe=`dmenu_path | dmenu -b` eval \exec $exe\) , ((modm, xK_F11), spawn sudo shutdown -r now) , ((modm, xK_F12), spawn sudo shutdown -h now) , ((modm .|. controlMask, xK_Print), spawn sleep 0.2; scrot -s) , ((modm, xK_Print), spawn scrot '/tmp/%Y-%m-%d_%H:%M:%S_$wx$h_scrot.png' -e 'mv $f ~') , ((modm, xK_c), kill) -- Window Navigation , ((modm, xK_Right), sendMessage $ Go R) , ((modm, xK_Left ), sendMessage $ Go L) , ((modm, xK_Up ), sendMessage $ Go U) , ((modm, xK_Down ), sendMessage $ Go D) -- swap... , ((modm .|. controlMask, xK_Right), sendMessage $ Swap R) , ((modm .|. controlMask, xK_Left ), sendMessage $ Swap L) , ((modm .|. controlMask, xK_Up ), sendMessage $ Swap U) , ((modm .|. controlMask, xK_Down ), sendMessage $ Swap D) ] - fac n = foldr (*) 1 [1..n] -- View this message in context: http://old.nabble.com/About-xmonad-tp26367498p26367498.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe You should try asking on the xmonad mailing list: http://www.haskell.org/mailman/listinfo/xmonad -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: acme-dont
2009/11/9 Gracjan Polak gracjanpo...@gmail.com: Hello fellow haskellers, While reading reddit in the morning today: http://www.reddit.com/r/programming/comments/a26fe/dont/ I was shocked and surprised to see that Haskell lacks a very important feature present in Perl. It appeared that Haskell cannot not do monadic actions! I decided to act as fast as possible. Luckily, monads enable us to create control flow constructs on enterprise level. I'm proud to present the Acme.Dont module, that implements the indispensable don't monadic action. http://hackage.haskell.org/package/acme-dont-1.0 With special apologies to Luke Palmer that it took the Haskell community 7.5 years to catch up with Perl. Thanks go to Damian Conway. Have fun! Gracjan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Are you sure you want to license this as BSD? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Is () a 0-length tuple?
2009/11/7 Matthew Gruen wikigraceno...@gmail.com: Forgot to cc haskell-cafe. Trying again: -- Forwarded message -- From: Matthew Gruen wikigraceno...@gmail.com Date: Sat, Nov 7, 2009 at 2:16 PM Subject: Re: [Haskell-cafe] Is () a 0-length tuple? To: Pasqualino Titto Assini tittoass...@gmail.com On Sat, Nov 7, 2009 at 2:00 PM, Pasqualino Titto Assini tittoass...@gmail.com wrote: The syntax is similar, but what else is? In JavaScript there is a null value, that is the only value of the null type. Isn't () the same thing? The only value of the unary type? Best, titto Pasqualino Titto Assini, Ph.D. http://quicquid.org/ In JavaScript's case, there is not a null type. The null value belongs to the 'object' type, whereas the undefined value belongs to the 'undefined' type. This is all a lot less useful when you realize that JavaScript has a dynamic type system. But this is JSON, not JavaScript. In JSON, arrays, objects, strings, and numbers can be any number of values. Booleans can be two values. Null can only be one value. Personally, I think a better mapping for () would be JSNull, since both have only one value in normal form. However, there is not necessarily any natural mapping between Haskell values and JSON values. The library tries to provide as many as possible, including (), which it happens to map to JSArray [] instead of JSNull. As long as the library is internally consistent, though, it should be fine. What point are you trying to make by distinguishing JSON from JavaScript? JSON is a subset of JavaScript, they share the same type system. Null can be only one value. This doesn't make sense to me, since as you say null is not a type, but a value. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Is () a 0-length tuple?
2009/11/8 Matthew Gruen wikigraceno...@gmail.com: On Sun, Nov 8, 2009 at 6:21 AM, Deniz Dogan deniz.a.m.do...@gmail.com wrote: What point are you trying to make by distinguishing JSON from JavaScript? JSON is a subset of JavaScript, they share the same type system. Null can be only one value. This doesn't make sense to me, since as you say null is not a type, but a value. -- Deniz Dogan It seems I underestimated the typedness of null in JavaScript :) I checked the ECMAScript specification, and it does refer to a null type.. so titto was right.[1] My opinion is that JSON's 'type system' should be analyzed orthogonal to JavaScript's regardless. If JSON is a subset of JavaScript, it is primarily a syntactic one. When I said Null can be only one value, implying that null is a type, I was referring to JSON's null, not JavaScript's null. In JSON, null *is* definitely a unit type. When considering mappings between Haskell and JSON in the case of (), we should see that () is a unit type in Haskell, null is a unit type in JSON (regardless of its role in JavaScript), and maybe try to associate them. —Matt [1] I was misled by the fact that typeof null = 'object'. The logic behind this, I think, is that null is meant to be bound to a variable that would otherwise be a reference to an actual object value. Many have criticized this result, e.g. Douglas Crockford (http://javascript.crockford.com/remedial.html) Let's keep in mind when reading the ECMAScript specification that JavaScript is merely based on it and breaks it on several different points. :) -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What's the deal with Clean?
2009/11/5 Erik de Castro Lopo mle...@mega-nerd.com: Andrew Coppin wrote: I'm dissapointed that Haskell doesn't have *more* of a Windows bias. It _is_ the platform used by 90% of the desktop computers, after all. (As unfortunate as that undeniably is...) That is not true in my home and its not true where I work. In addition, saying 90% of all desktop computers is misleading; instead we should be talking about the computers of software developers and there, the figure is almost certainly well below 90%. Why? After all, software is always (in one way or another) written for users, not other software developers. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Master's thesis topic sought
2009/11/5 Andrew Coppin andrewcop...@btinternet.com: Matus Tejiscak wrote: zygohistomorphic prepromorphisms Please tell me this isn't a real technical term. o_O http://www.haskell.org/haskellwiki/Zygohistomorphic_prepromorphisms Still can't tell if it's a joke or not... -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Master's thesis topic sought
2009/11/6 Erik de Castro Lopo mle...@mega-nerd.com: Stefan Holdermans wrote: http://people.cs.uu.nl/stefan/pubs/hage08heap.html Getting connection refused on that. Try this one, from Google's cache: http://preview.tinyurl.com/ydjuw2j -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Master's thesis topic sought
2009/11/6 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/11/6 Erik de Castro Lopo mle...@mega-nerd.com: Stefan Holdermans wrote: http://people.cs.uu.nl/stefan/pubs/hage08heap.html Getting connection refused on that. Try this one, from Google's cache: http://preview.tinyurl.com/ydjuw2j -- Deniz Dogan Oops, those were slides. Here is the paper: http://preview.tinyurl.com/ycmneko -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Emacs: Haskell snippets for YASnippet
2009/11/4 Daniel Schüssler anotheraddr...@gmx.de: Hi List, this is rather trivial, but maybe someone else finds these useful: darcs get http://code.haskell.org/~daniels/haskell-snippets/ Especially the LANGUAGE ones have saved me quite some typing :) Additions welcome. Usage: If not already installed, get YASnippet: http://code.google.com/p/yasnippet/ and put this into your .emacs: (load-file some-path/haskell-snippets.el) to expand a snippet, just enter the macro string (these are listed in the haskell-snippets.el file) and press tab. If the snippet has holes, press tab again to jump to the next hole. Greetings, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Cool stuff, I will probably be using this! In my opinion, the naming convention is a bit inconsistent. Extension snippets all begin with -x but imports begin with imp. I'd prefer seeing import snippets begin with -i and use names easier to remember, e.g. instead of impcms, use -istate and instead of impdm.Map use -imap, etc. At least consider it! :) And about the bot - ⊥ rule... Is ⊥ really valid Haskell? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Announce: language-python version 0.2 now available
2009/11/4 Bernie Pope florbit...@gmail.com: Main shortcomings of this release: - Support for Unicode is limited (waiting on Unicode support in Alex). There was an announcement a while back on this list from Jean-Philippe Bernardy about successfully adding Unicode support to Alex. http://www.mail-archive.com/haskell-cafe@haskell.org/msg62848.html -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Daniel Schüssler anotheraddress @gmx.de
2009/11/4 Stefan Monnier monn...@iro.umontreal.ca: this is rather trivial, but maybe someone else finds these useful: darcs get http://code.haskell.org/~daniels/haskell-snippets/ Since Emacs already comes bundled with several template systems (at least skeleton.el and tempo.el, where the first seems to be marginally more canonical), I think it would be better to define your templates using skeleton and thus remove the dependency on yasnippet. Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe You guys sure have been good at hiding skeleton.el... The impression I've gotten from a couple of years in #emacs is that yasnippet is the way to go. I'll translate my own snippets to skeleton a.s.a.p. :P -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] What's the deal with Clean?
Recently there has been a lot of discussion on this list about the programming language Clean and converting Clean programs to Haskell. Reading the Wikipedia article on the language, I can't really see any major difference between that and Haskell, except for the monads vs. uniqueness types. So what's the deal with Clean? Why is it preferable to Haskell? Why is it not? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?
2009/10/30 Martijn van Steenbergen mart...@van.steenbergen.nl: Magnus Therning wrote: IIRC James Gosling once said that if he were to design Java today he would leave out classes. I suppose partly due to many of the issues with data inheritance. This sounds interesting. Can you link us to an article, please? Thanks, Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe http://peter.michaux.ca/articles/transitioning-from-java-classes-to-javascript-prototypes (Under Second Tactic) -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: xmonad 0.9 is now available!
2009/10/26 zaxis z_a...@163.com: xmonad is great WM i have ever seen. I have used it for a long time. However, i donot know whether or not it is a *good* combination to use xmonad and lxpanel together insead of dzen . Take a look at XMonad.Prompt from xmonad-contrib, it's sick. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: haskell-mode 2.5
2009/10/25 Svein Ove Aas svein@aas.no: Fellow Haskellers, I'm happy to announce the release of haskell-mode 2.5. * By web: http://projects.haskell.org/haskellmode-emacs/ * By darcs: http://code.haskell.org/haskellmode-emacs/ Furthermore, there is a change of maintainer; if you have issues, you should now contact me instead of Stefan Monnier. haskell-mode 2.5 = I was uncertain whether to mark this a minor or major release. On the one hand, very little has changed in core functionality. On the other, a new minor mode for indentation has been added: haskell-indentation.el, written by Kristof Bastiaensen. It will be familiar to those of you who have been tracking the CVS repository; there are only minor bug-fixes relative to the last version to be uploaded there. For the rest of you: haskell-indentation.el is an intelligent indentation mode in the style of haskell-indent.el, with a few changes to improve usability. Specifically, instead of a tab cycle, backspace is now used to reduce the nesting level, while tab will increase it. The behaviour is otherwise substantially the same; only valid nestings will be considered. It can be turned on by adding (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) to your .emacs file, as described in the README. As usual, it is mutually exclusive with the two other indentation modes. Known bugs: * Occasionally, the haskell-indentation parser will get stuck on what it considers to be invalid haskell code, and refuse to accept your commands; this includes, mainly, haskell-newline-and-indent. To avoid annoyance, if you bind RET to haskell-newline-and-indent, you should bind M-RET to plain newline. -- Svein Ove Aas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Great news! -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: mecha-0.0.0
Hackage link: http://hackage.haskell.org/package/mecha/ 2009/10/22 John Van Enk vane...@gmail.com: Is this on hackage yet, or should we just consult the mecha link on your home page? On Wed, Oct 21, 2009 at 11:42 PM, Tom Hawkins tomahawk...@gmail.com wrote: A few months ago, I started toying with a few alternative pump designs to power our hydraulic hybrids. After not being able to secure a ProE license, I searched for a free solid modeler to sketch out a few ideas. To my surprise, their are practically no open source 3D CAD packages available. So I created Mecha, DSL for constructive solid modeling. Mecha's geometry is based on octrees, which makes it easy to perform set operations on solids, as well as volumetric calculations such as center-of-mass, moments of inertia, and of course, total volume. Drawbacks of octrees include consuming a lot of memory and the loss of some surface information. To address the later, Mecha carries forward surface points and normals to the leaf nodes of the octree to assist in rendering, such that solids don't look like they're made from a bunch of LEGOS. Note this is a very early release. The only thing Mecha can do at the moment is draw a pretty blue ball -- well it can also zoom and pan on a pretty blue ball (mouse wheel). Establishing a primitive API and building a primitive library must be finished before Mecha an do anything useful. Any comments and suggestions are welcome. http://tomahawkins.org/ ___ 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] Hackage down
2009/10/19 Dougal Stanton dou...@dougalstanton.net: Has not been responding for at least the last 12 hours. Is there somewhere to look for status reports on sysadmin details like this, so we can tell if - it's a scheduled down time - it's a problem but the admins know about it - etc etc. D The explanations I heard were: * The Galois guys got their math wrong and folded monk's disk into R^0 space. * Might be concerned with CERN. * lambdabot hacked Hackage and uses it to plot her plans for world-domination, faster. All from the same person, incidentally! -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Best Editor In Windows
2009/10/16 Gregory Crosswhite gcr...@phys.washington.edu: In my humble opinion, one of the best editors for development of all time is Leo: http://webpages.charter.net/edreamleo/front.html Leo takes the idea of code folding and gives you complete control over it. That is, unlike other editors which only let you fold the code inside if/while/for/etc. statements and which only show you an outline consisting of a level for files and a level for function, Leo lets you structure the levels of your outline arbitrarily so that you can fold arbitrary chunks of code and do things like grouping together functions and files with a similar purpose or implementation. By structuring your code as an outline, you make it easier for others and yourself both to navigate through the code and also to see at a glance the high-level structure. Anyway, just wanted to use this opportunity to plug my favorite tool. :-) The downside about it is that the implementation sometimes feels a bit slow and clunky, so part of me really hopes that at the very least people will learn enough about this tool to take its ideas and steal them for other editors! Cheers, Greg This should come as no surprise, but Emacs can do this as well. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] type inference question
2009/10/8 Cristiano Paris fr...@theshire.org: On Thu, Oct 8, 2009 at 11:04 AM, minh thu not...@gmail.com wrote: Hi, I'd like to know what are the typing rules used in Haskell (98 is ok). Specifically, I'd like to know what makes let i = \x - x in (i True, i 1) legal, and not let a = 1 in (a + (1 :: Int), a + (1.0 :: Float)) Is it correct that polymorphic functions can be used polymorphically (in multiple places) while non-functions receive a monomorphic type ? First, 1 IS a constant function so it's in no way special and is a value like any other. I thought all functions in lambda calculus, technically, take exactly one argument? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[4]: [Haskell-cafe] Creating an alias for a function
2009/10/7 michael rice nowg...@yahoo.com Actually I used it to fake the Pascal ord(x) function: ord = fromEnum Problem? Michael If the monomorphism restriction applies, the compiler (assuming you're using GHC) will tell you about it. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[6]: [Haskell-cafe] Creating an alias for a function
2009/10/7 Bulat Ziganshin bulat.zigans...@gmail.com: Hello Deniz, Wednesday, October 7, 2009, 5:03:59 PM, you wrote: it depends. what i see with ghc 6.6.1: [snip] Possible cause: the monomorphism restriction applied to the following: ord :: a - Int (bound at test.hs:1:0) Probable fix: give these definition(s) an explicit type signature or use -fno-monomorphism-restriction I don't see the problem? GHC seems to tell you about the monomorphism restriction in your example. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] dsl and gui toolkit
2009/10/6 John A. De Goes j...@n-brain.net: CSS is a good start by it's beset by all the problems of a 1st generation presentation language, and is not particularly machine-friendly. I think CSS is neat for websites, but I'm not so sure about using it in normal applications. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] I/O Haskell question
2009/10/5 Maria Boghiu maria.bog...@gmail.com: I get an error saying I am mismatching types IO [String] and [String]. Something of the type IO [String] is a computation which does some IO (reading files, launching nukes, etc.) and then returns a list of strings. Something of the type [String] is merely a list of strings. It is impossible (I'm lying here, but for a good cause) to convert something on the form IO a to just a. Try something like this: main = do fileContent - readFile /path/to/file xmonad $ defaultConfig { ... workspaces = lines fileContent, ... } ... -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.
2009/9/30 Andrew Coppin andrewcop...@btinternet.com: (Mr C++ argues that homo sapiens fundamentally think in an imperative way, and therefore functional programming in general will never be popular. Sounds more like Mr C++ fundamentally thinks in an imperative way because that's what he is used to. I recently started working with C# and struggled for way too long with for/foreach loops to do things that in Haskell could be expressed using only folding, mapping and filtering. When I realised that those ideas actually exist in System.Linq I suddenly started liking the language a bit more. txtCommaSeparatedNames.Text.Split(',').Select(x = x.Trim()).Where(x = x.Length 0).Select(x = Convert.ToInt32(x)).ToList(); Ah, the joy of FP. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: [Haskell-beginners] map question
2009/9/17 Joost Kremers joostkrem...@fastmail.fm Hi all, I've just started learning Haskell and while experimenting with map a bit, I ran into something I don't understand. The following commands do what I'd expect: Prelude map (+ 1) [1,2,3,4] [2,3,4,5] Prelude map (* 2) [1,2,3,4] [2,4,6,8] Prelude map (/ 2) [1,2,3,4] [0.5,1.0,1.5,2.0] Prelude map (2 /) [1,2,3,4] [2.0,1.0,0.,0.5] But I can't seem to find a way to get map to substract 1 from all members of the list. The following form is the only one that works, but it doesn't give the result I'd expect: Prelude map ((-) 1) [1,2,3,4] [0,-1,-2,-3] I know I can use an anonymous function, but I'm just trying to understand the result here... I'd appreciate any hints to help me graps this. TIA Joost The reason that map (-1) [1,2,3,4] doesn't work as you'd expect it to is that - is ambiguous in Haskell (some may disagree). -1 means -1 in Haskell, i.e. negative 1, not the function that subtracts 1 from its argument. (-) 1 is the function that subtracts its argument from 1, which is not what you were looking for either! You're looking for the function that subtracts 1 from its argument, which is `subtract 1'. Prelude map (subtract 1) [1..4] [0,1,2,3] Note that `subtract' is just another name for `flip (-)', i.e. subtraction with its argument in reverse order. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cabal install on Windows 7
2009/9/10 Sebastian Sylvan sebastian.syl...@gmail.com: On Thu, Sep 10, 2009 at 10:58 AM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: On Wed, 2009-09-09 at 20:19 +0100, Sebastian Sylvan wrote: On Wed, Sep 9, 2009 at 1:28 PM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: If the Windows users can come to a consensus on whether the default should be global or user, then we can easily switch it. The same applies for the default global or user installation paths. I think it's morally right to run as user by default. Yes, the windows culture has some legacy that may, on occasion, make it slightly harder to use well behaved programs, but it's fairly minor these days. So is it just a matter of switching the default, or do the default user paths have to change too? Is there any recommended/sensible place for installing per-user applications on Windows? (I think there wasn't on XP, but perhaps that's changed on Vista/Win7) I think it's %LOCALAPPDATA% -- Sebastian Sylvan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Is there any %LOCALAPPDATA% on Windows XP? If not, what is the difference between %LOCALAPPDATA% and %APPDATA% in Windows Vista/7? I was thinking if it's not unreasonable to store Cabal stuff in %APPDATA%, one might as well use that and cover XP, Vista and 7 all in one. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Efficient functional idiom for histogram
2009/8/1 Paul Moore p.f.mo...@gmail.com: BTW, I did know that Haskell had an efficient map implementation, I just wasn't sure how to use it functionally - I probably should have searched a bit harder for examples before posting. Thanks for the help in any case. Know that Data.Map uses size balanced trees and is not e.g. a hash map. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] gtk2hs tray icon disappears when using GHCi
Hi I'm just trying out gtk2hs for the first time and I quite like it. However, for some reason my tray icon (...Gtk.Display.StatusIcon) disappears after a split second when I run my program using GHCi. What's the reason for this? Perhaps this is even a bug? It works just fine if I compile an .exe. I'm using Windows XP with GHC 6.10.3 and gtk2hs 0.10.1. import Graphics.UI.Gtk import Graphics.UI.Gtk.Display.StatusIcon main :: IO () main = do initGUI window - windowNew tray - statusIconNewFromFile c:/Program Files/TortoiseHg/icons/commit.png window `onDestroy` mainQuit widgetShowAll window mainGUI -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] List spine traversal
2009/6/29 Martijn van Steenbergen mart...@van.steenbergen.nl: Tony Morris wrote: Is there a canonical function for traversing the spine of a list? I could use e.g. (seq . length) but this feels dirty, so I have foldl' (const . const $ ()) () which still doesn't feel right. What's the typical means of doing this? (seq . length) doesn't sound that bad to me. Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe What is the spine of a list? Google seems to fail me on this one. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Half-integer
2009/6/28 Andrew Coppin andrewcop...@btinternet.com: Felipe Lessa wrote: On Sun, Jun 28, 2009 at 02:24:30PM +0100, Andrew Coppin wrote: Now, the question is... Is this useful enough to be worth putting on Hackage? Why not? :) Well, it *does* mean I'll have to figure out how Cabal actually works... Usually, it's pretty straight-forward and most options are self-explanatory. http://en.wikibooks.org/wiki/Haskell/Packaging#The_Cabal_file -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] HaRe (the Haskell Refactorer) in action - short screencast
2009/6/23 Claus Reinke claus.rei...@talk21.com: I've heard that many Haskellers know HaRe only as a rumour. It has been many years since the original project finished, and HaRe hasn't been maintained for quite some time, so just pointing to the sources isn't quite the right answer. The sources are still available, and build with GHC 6.8.3 (I had to fix one lineending issue on windows, iirc, and copy one old bug fix that hadn't made it into the latest release), but there is currently noone with the time or funding for maintenance, fixing bugs, making releases, or ironing out practical issues. If anyone would provide funding, people to do the work could be found, but the effort would probably be better spent on reimplementing the ideas in a GHC / Cabal environment (instead of the Haskell'98 environment targetted by our Refactoring Functional Programs project). If you've got the funding, please get in touch - even a three month run could get something started at least!-) In principle, the project experiences and lessons learned are quite well documented at the project site http://www.cs.kent.ac.uk/projects/refactor-fp/ but that doesn't give anyone an idea of what working with HaRe was like. With the recent interest in screencasts, I thought I'd make a little demo, for archival purposes. Nothing fancy, using only features that were already present in HaRe 0.3 (end of 2004), and not all of those, on a tiny 2-module example (screenspace is a bit crowded to keep the text readable on YouTube). I hope it might give a rough idea of what the papers, slides and reports are talking about, for Haskellers who weren't around at the time: http://www.youtube.com/watch?v=4I7VZV7elnY For the old HaRe team, Claus --- YouTube video description: HaRe - the Haskell Refactorer (a mini demo) [4:10] The Haskell Refactorer HaRe was developed in our EPSRC project Refactoring Functional Programs http://www.cs.kent.ac.uk/projects/refactor-fp/ Building on Programatica's Haskell-in-Haskell frontend and Strafunski's generic programming library, it supported module-aware refactorings over the full Haskell'98 language standard. Interfaces to the refactoring engine were provided for both Vim and Emacs (this demo uses HaRe via GVim on Windows). While HaRe has continued to see occasional contributions by students and researchers, who use its Haskell program transformation API as a platform for their own work, it is not currently maintained. As the Haskell environment marches on, this demo is meant to record a snapshot of what working with HaRe could be like when it still built (here with GHC 6.8.3). The lessons learned (note, eg, the preservation of comments, and the limited use of pretty-printing, to minimize layout changes) are well documented at the project site, and should be taken into account when porting the ideas to the GHC Api, or other Haskell frontends. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe It would be interesting to see if the Yi developers could implement some of this functionality for the Haskell mode, which has become quite nice and is under active development. It already has a dollarification function which converts stuff like hello (there (how (are you))) into hello $ there $ how $ are you (I'm bad at coming up with examples). -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How to determine if a FilePath is a directory name or regular file?
2009/6/22 Colin Paul Adams co...@colina.demon.co.uk: Judah == Judah Jacobson judah.jacob...@gmail.com writes: Judah On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul Judah Adamsco...@colina.demon.co.uk wrote: I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns sub-directories as well as file names. I want only the latter, so I'm looking for a suitable filter. Judah Use System.Directory.doesDirectoryExist/doesFileExist. Thanks. it seems it's time i went to the optician again. I'm not surprised that anyone would make the mistake. I think that the two functions should be named isDirectory and isFile, but it seems that isDirectory was already taken by another function in System.Directory, which is quite unfortunate. does goes against the intuition one gets from pretty much everything else in Haskell, where is seems to be the convention. In fact, Hoogle only knows about three functions which start with does. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How to determine if a FilePath is a directory name or regular file?
2009/6/22 Duncan Coutts duncan.cou...@worc.ox.ac.uk: On Mon, 2009-06-22 at 08:53 +0200, Deniz Dogan wrote: 2009/6/22 Colin Paul Adams co...@colina.demon.co.uk: Judah == Judah Jacobson judah.jacob...@gmail.com writes: Judah On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul Judah Adamsco...@colina.demon.co.uk wrote: I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns sub-directories as well as file names. I want only the latter, so I'm looking for a suitable filter. Judah Use System.Directory.doesDirectoryExist/doesFileExist. Thanks. it seems it's time i went to the optician again. I'm not surprised that anyone would make the mistake. I think that the two functions should be named isDirectory and isFile, but it seems that isDirectory was already taken by another function in System.Directory, which is quite unfortunate. does goes against the intuition one gets from pretty much everything else in Haskell, where is seems to be the convention. In fact, Hoogle only knows about three functions which start with does. One explanation is that isBlah asks is this thing a blah, but we're not asking that because there is an indirection via the filepath. We're asking does this filepath refer to a directory not is this filename a directory. The latter could be a function: isDirectory :: FileInfo - Bool along with a hypothetical getFileInfo :: FilePath - IO FileInfo Duncan I think see what you mean, but I find the argument more of an excuse to the poor naming than a solid argument for it. Following the convention and intuition that most users have should be more important than making the (sometimes unnecessary) distinction between a directory and the path to it. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How to determine if a FilePath is a directory name or regular file?
2009/6/22 Max Rabkin max.rab...@gmail.com: On Mon, Jun 22, 2009 at 2:09 PM, Deniz Dogandeniz.a.m.do...@gmail.com wrote: I think see what you mean, but I find the argument more of an excuse to the poor naming than a solid argument for it. Following the convention and intuition that most users have should be more important than making the (sometimes unnecessary) distinction between a directory and the path to it. I disagree. (isDirectory /no/such/directory/) should equal true: the given FilePath is a directory path (on Unix), since it ends with a slash. However (doesDirectoryExist /no/such/directory) should return false, since there is no such directory. Are you saying that when a function is named isDirectory you expect it to only check for a trailing forward slash character? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Slightly off-topic: Lambda calculus
2009/6/21 Andrew Coppin andrewcop...@btinternet.com: OK, so I'm guessing there might be one or two (!) people around here who know something about the Lambda calculus. I've written a simple interpretter that takes any valid Lambda expression and performs as many beta reductions as possible. When the input is first received, all the variables are renamed to be unique. Question: Does this guarantee that the reduction sequence will never contain name collisions? I have a sinking feeling that it does not. However, I can find no counter-example as yet. If somebody here can provide either a proof or a counter-example, that would be helpful. I'm no expert, but it sounds to me like you're doing the equivalent of de Bruijn indexing, which is a method to avoid alpha conversion, which is basically what you're worried about. Therefore, I'm guessing that there will be no name collisions. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] coding standard question
2009/6/22 Vasili I. Galchin vigalc...@gmail.com: Hello, I am working with some existing code. where/let functions use the same name for function parameters as the outer function and hence there is a shadow warning from the compiler. To me it doesn't see totally unreasonable to code like this the downside is the nasty ghc warnings. Is there a coding consensus on this issue? Vasili I say you should change it. Any maintainer of code with shadowed variables could easily be confused, no matter what the language is. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Code walking off the right edge of the screen
I (too) often find myself writing code such as this: if something then putStrLn howdy there! else if somethingElse then putStrLn howdy ho! else ... I recall reading some tutorial about how you can use the Maybe monad if your code starts looking like this, but as you can see, that doesn't really apply here. something and somethingElse are simply booleans and each of them have different actions to take if either of them is True. So how do I make code like this prettier? Thanks, Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Running a sub-process which dies with the main program
2009/6/18 Deniz Dogan deniz.a.m.do...@gmail.com: Hi I couldn't come up with a better subject than this one, so anyways... I have a small program which spawns a subprocess. However, when I hit C-c, the subprocess won't die, instead it will just keep running until it's done or until I kill it. I've looked around in System.Process for something suitable for my needs, but I can't seem to find it. Any ideas? With a tip from a person outside of the mailing list I found System.Process.system, which essentially does exactly what I was asking for. However, I would really like some more control over what file descriptors the subprocess should use (specifically stdout and stderr). Looking at the source code for System.Process.system, I find that it uses the syncProcess function, which would be useful to me, but isn't exported. So why is syncProcess not exported? Is there any good reason not to? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Running a sub-process which dies with the main program
2009/6/19 Aycan iRiCAN aycan.iri...@core.gen.tr: Cum, 2009-06-19 tarihinde 11:58 +0200 saatinde, Deniz Dogan yazdı: 2009/6/18 Deniz Dogan deniz.a.m.do...@gmail.com: Hi I couldn't come up with a better subject than this one, so anyways... I have a small program which spawns a subprocess. However, when I hit C-c, the subprocess won't die, instead it will just keep running until it's done or until I kill it. I've looked around in System.Process for something suitable for my needs, but I can't seem to find it. Any ideas? With a tip from a person outside of the mailing list I found System.Process.system, which essentially does exactly what I was asking for. Hey I'm already subscribed :) You can read from sout and serr with below example. Hope that it helps. module Main where import System.Process -- using process-1.0.1.1 main = do (_, sout, serr, p) - createProcess (proc sleep [10]) { std_out = CreatePipe , std_err = CreatePipe } r - waitForProcess p return () Thanks! But this was the approach I used before I went to System.Process.system and it did not work on my Linux machine. Looking at the source code for system, we see that it uses syncProcess, which has #ifdef mingw32_HOST_OS (IIRC) in which the code you gave me resides. If mingw32_HOST_OS is not defined, one has to go through quite a bit more trouble to get the same effect. This is why it bugs me a bit that syncProcess is not exported. I can't find any reason not to export it, but what do I know? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Running a sub-process which dies with the main program
2009/6/19 Aycan iRiCAN aycan.iri...@core.gen.tr: Cum, 2009-06-19 tarihinde 12:42 +0200 saatinde, Deniz Dogan yazdı: 2009/6/19 Aycan iRiCAN aycan.iri...@core.gen.tr: Cum, 2009-06-19 tarihinde 11:58 +0200 saatinde, Deniz Dogan yazdı: 2009/6/18 Deniz Dogan deniz.a.m.do...@gmail.com: Hi I couldn't come up with a better subject than this one, so anyways... I have a small program which spawns a subprocess. However, when I hit C-c, the subprocess won't die, instead it will just keep running until it's done or until I kill it. I've looked around in System.Process for something suitable for my needs, but I can't seem to find it. Any ideas? With a tip from a person outside of the mailing list I found System.Process.system, which essentially does exactly what I was asking for. Hey I'm already subscribed :) You can read from sout and serr with below example. Hope that it helps. module Main where import System.Process -- using process-1.0.1.1 main = do (_, sout, serr, p) - createProcess (proc sleep [10]) { std_out = CreatePipe , std_err = CreatePipe } r - waitForProcess p return () Thanks! But this was the approach I used before I went to System.Process.system and it did not work on my Linux machine. Give it a try. Try to send CTRL-C and look if sleep 10 (which is a subprocess) process terminates. ay...@aycan:~/haskell$ time ./deniz2 ps -ef | grep sleep ^C real 0m0.707s user 0m0.001s sys 0m0.004s aycan 13098 4430 0 13:50:23 pts/7 0:00 grep sleep It terminates with ghc 6.10.3 on OpenSolaris. This is copied verbatim from my terminal. I used the exact some code that you gave me. % time ./test ps -ef | grep sleep ^C real0m10.005s user0m0.003s sys 0m0.003s deniz14095 14047 0 13:05 pts/100:00:00 grep sleep What's strange though is that when I hit C-c *twice*, I get this behavior: time ./test ps -ef | grep sleep ^C^C real0m0.915s user0m0.003s sys 0m0.000s This is with GHC 6.10.3 on Arch Linux i686. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Running a sub-process which dies with the main program
2009/6/19 Aycan iRiCAN aycan.iri...@core.gen.tr: Cum, 2009-06-19 tarihinde 13:09 +0200 saatinde, Deniz Dogan yazdı: 2009/6/19 Aycan iRiCAN aycan.iri...@core.gen.tr: Cum, 2009-06-19 tarihinde 12:42 +0200 saatinde, Deniz Dogan yazdı: 2009/6/19 Aycan iRiCAN aycan.iri...@core.gen.tr: Cum, 2009-06-19 tarihinde 11:58 +0200 saatinde, Deniz Dogan yazdı: 2009/6/18 Deniz Dogan deniz.a.m.do...@gmail.com: Hi I couldn't come up with a better subject than this one, so anyways... I have a small program which spawns a subprocess. However, when I hit C-c, the subprocess won't die, instead it will just keep running until it's done or until I kill it. I've looked around in System.Process for something suitable for my needs, but I can't seem to find it. Any ideas? With a tip from a person outside of the mailing list I found System.Process.system, which essentially does exactly what I was asking for. Hey I'm already subscribed :) You can read from sout and serr with below example. Hope that it helps. module Main where import System.Process -- using process-1.0.1.1 main = do (_, sout, serr, p) - createProcess (proc sleep [10]) { std_out = CreatePipe , std_err = CreatePipe } r - waitForProcess p return () Thanks! But this was the approach I used before I went to System.Process.system and it did not work on my Linux machine. Give it a try. Try to send CTRL-C and look if sleep 10 (which is a subprocess) process terminates. ay...@aycan:~/haskell$ time ./deniz2 ps -ef | grep sleep ^C real 0m0.707s user 0m0.001s sys 0m0.004s aycan 13098 4430 0 13:50:23 pts/7 0:00 grep sleep It terminates with ghc 6.10.3 on OpenSolaris. This is copied verbatim from my terminal. I used the exact some code that you gave me. % time ./test ps -ef | grep sleep ^C real 0m10.005s user 0m0.003s sys 0m0.003s deniz 14095 14047 0 13:05 pts/1 00:00:00 grep sleep What's strange though is that when I hit C-c *twice*, I get this behavior: Hmm, I think GHC RTS handles SIGINT. I recompiled with thread support and got the same behavour. See: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Signals When the interrupt signal is received, the default behaviour of the runtime is to attempt to shut down the Haskell program gracefully. It does this by calling interruptStgRts() in rts/Schedule.c (see Commentary/Rts/Scheduler#ShuttingDown). If a second interrupt signal is received, then we terminate the process immediately; this is just in case the normal shutdown procedure failed or hung for some reason, the user is always able to stop the process with two control-C keystrokes. You better install signal handlers using installHandler. Best Regards, But that's what syncProcess does when mingw32_HOST_OS is not defined. Also, compiling without -threaded doesn't help the problem on my machine, it still acts the same. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Running a sub-process which dies with the main program
Hi I couldn't come up with a better subject than this one, so anyways... I have a small program which spawns a subprocess. However, when I hit C-c, the subprocess won't die, instead it will just keep running until it's done or until I kill it. I've looked around in System.Process for something suitable for my needs, but I can't seem to find it. Any ideas? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ghc does not link after compiling
2009/6/17 Nico Rolle nro...@web.de: hi I wanted to compile my little test programm so it can take advantage of a multicore system. But when i call the compiler with ghc -O2 --make Benchmark.hs -threaded it just produces a acouple of .hi and .o files but no executable. But in the documantation was written that i just need to call ghc like that and it will produce my desired executable. My version of ghc is 6.10.3 regards ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Is the module name Main? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Documentation on hackage
2009/6/15 minh thu not...@gmail.com: 2009/6/15 Uwe Schmidt s...@fh-wedel.de: Dear Haskellers, who needs this kind of documentation? http://hackage.haskell.org/packages/archive/tfp/0.2/doc/html/Types-Data-Num-Decimal-Literals.html isn't this a kind of spam? Hi, This is Template Haskell generated code... Cheers, Thu Not only can this webpage potentially crash the visitor's browser, I also don't think anyone anywhere would find that piece of documentation useful. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How to know the build dependencies?
2009/6/14 Gwern Branwen gwe...@gmail.com: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Sat, Jun 13, 2009 at 10:22 PM, Magicloud Magiclouds wrote: Hi, I am learning to use cabal for my code. Just when I start, I met a question, is there an easy way to find out what packages my code depends? Thanks. Not really. The easiest way is to just build your code and add every package Cabal complains about being hid into your build-depends. (Usually this won't take more than a minute or 3 if you're toggling between a terminal and an editor.) - -- gwern Someone really ought to write a tool for this... -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How to know the build dependencies?
2009/6/14 Gwern Branwen gwe...@gmail.com: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Sun, Jun 14, 2009 at 6:05 AM, Deniz Dogan wrote: Someone really ought to write a tool for this... Well, it's an issue of time. Just building and adding the deps is fast and straightforward. A tool I'd need to know about, have installed, and remember to use in the middle of a Cabalizing session. The people who most need such a tool are those who are least likely to use it. And given the overhead, it's unclear that it would actually save time. Sometimes, somethings aren't worth automating. Now, if someone were to create such a tool and integrate it into 'mkcabal', then it might make sense. You could create the basic .cabal with the build-depends filled in. But as a separate tool it's too small a task to handle. Even memorizing the -show-iface or - -ddump-types options may not be worthwhile - how often does one create Cabal packages from scratch? I'm sorry, I was not aware of those flags when I wrote my message. You're right. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell - string to list isusses, and more
2009/6/14 Gjuro Chensen daim...@gmail.com: Hello everyone! Im a Haskell newbie, and Ive have few unanswered questions. For someone more experienced (at least I think so) its a very simple task, but I just cant get a grip on it and its pretty frustrating. It wouldn't be that bad if I haven't browse thru bunch of pages and tutorials and still nothing... The problem is: take a string, and if every words starts with uppercase letter then print yes, else no. Forum Text Bold - yes Frog image File - no Ive had my share of approaches to this, but I just cant make it work. Standard one seemed the most simple: search :: String - String search [] = [] and then use words (splits string on space) to split the string so I could get a list and go through it recursively. But how to apply words to entered string in this form? To find the first letter I came up with: first = take 1 (head x). And compare it with elem or ASCII values to determine if its upper case. Any help, advice or suggestion is appreciated. Thanks in advance! -- View this message in context: http://www.nabble.com/Haskell---string-to-list-isusses%2C-and-more-tp24022673p24022673.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe As you say, there are a number of possible approaches to take here. I'd say take a look at functions all [1] and isUpper [2], those should be all you need. * all takes a predicate (a function) and a list of elements. It returns True if that predicate holds for all of the elements in the list, otherwise False. * isUpper takes a Char and returns True if that character is an uppercase letter, otherwise False. [1] http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html [2] http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Char.html -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell - string to list isusses, and more
2009/6/14 Deniz Dogan deniz.a.m.do...@gmail.com: I'd say take a look at functions all [1] and isUpper [2], those should be all you need. Sorry, words is also needed for the idea I was thinking of. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell - string to list isusses, and more
2009/6/14 Toby Miller t...@miller.ms: Here's what I came up with. I especially like the 2nd version, even though it's longer, as it seems very declarative. caps1 s = all (\x - isUpper (head x)) (words s) caps2 s = all startsWithUpper (words s) where startsWithUpper w = isUpper (head w) I'm also fairly new to Haskell, so I would appreciate feedback from the more experienced. Thanks. Not that I'm very experienced myself, but I came up with the first idea as well: caps1 = all (isUpper . head) . words -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell - string to list isusses, and more
2009/6/14 Jochem Berndsen joc...@functor.nl: Toby Miller wrote: caps1 s = all (\x - isUpper (head x)) (words s) This seems fine, but you need to check that words never returns a list containing the empty string (otherwise `head' will fail). Is there any such case? I was thinking about that as well, but couldn't think of any case where head would be called on an empty list. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] curious about sum
2009/6/13 Jochem Berndsen joc...@functor.nl: Keith Sheppard wrote: Is there any reason that sum isn't strict? I can't think of any case where that is a good thing. Prelude sum [0 .. 100] *** Exception: stack overflow It is useful if the (+) is nonstrict; although I cannot think of any useful mathematical structure where (+) would be nonstrict. I remember needing a non-strict sum at least once, but I do not remember the exact application. But imagine having a (very) long list of numbers and you want to do A if the sum exceeds a small number, otherwise B. if sum [0..10] 10 then A else B However, this idea didn't work, because of strictness. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Check out my photos on Facebook
2009/6/13 Rakesh Malik invite+yn4n...@facebookmail.com: To sign up for Facebook, follow the link below: http://www.facebook.com/p.php?i=898160075k=Z5E62YTRPW2CUGGAX144X3r I followed that link, in case anyone cares. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANNOUNCE: hunp-0.0
Inspired by the CLI utility unp, which was nice but lacked some DWIM functionality, I developed hunp (or hünp, but pronounced hump because it's easier). It automagically calls the right unpacker program for you and works on both files and directories: $ hunp ~/download/something/ ...finds ~/download/something/hello.r00 and calls unrar x ~/download/something/hello.r00. $ hunp ~/howdy.tar.gz ...calls tar zxvf ~/howdy.tar.gz Get it from http://hackage.haskell.org/package/hunp or from git://github.com/skorpan/hunp.git Enjoy! -- Deniz Dogan PS. I was unable to find the thread on how to properly announce things on the mailing lists, so I hope everyone is okay with this going only to Haskell café. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
2009/6/12 Tom Lokhorst t...@lokhorst.eu: There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo I think the biggest problem making the batteries not look like batteries is that they don't look round. For that we need some careful gradenting of them, to make the bottoms of them look shadowed. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
2009/6/12 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/6/12 Tom Lokhorst t...@lokhorst.eu: There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo I think the biggest problem making the batteries not look like batteries is that they don't look round. For that we need some careful gradenting of them, to make the bottoms of them look shadowed. -- Deniz Dogan Attached is a new version of the same idea with a slight gradient on the batteries and a slightly thicker font for the signs. -- Deniz Dogan attachment: logo-1.svg___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
2009/6/12 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/6/12 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/6/12 Tom Lokhorst t...@lokhorst.eu: There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo I think the biggest problem making the batteries not look like batteries is that they don't look round. For that we need some careful gradenting of them, to make the bottoms of them look shadowed. -- Deniz Dogan Attached is a new version of the same idea with a slight gradient on the batteries and a slightly thicker font for the signs. -- Deniz Dogan I realise now that I forgot the little head on the plus side of the battery, so you'll just have to imagine it's there. ;) -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
2009/6/12 Thomas Davie tom.da...@gmail.com: On 12 Jun 2009, at 11:15, Deniz Dogan wrote: 2009/6/12 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/6/12 Tom Lokhorst t...@lokhorst.eu: There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo I think the biggest problem making the batteries not look like batteries is that they don't look round. For that we need some careful gradenting of them, to make the bottoms of them look shadowed. -- Deniz Dogan Attached is a new version of the same idea with a slight gradient on the batteries and a slightly thicker font for the signs. With various people's ideas taken into account, I've created a new version of my attempt: http://www.cs.kent.ac.uk/people/rpg/tatd2/logo-1.png http://www.cs.kent.ac.uk/people/rpg/tatd2/logo-1.svg I think the yellow/black is easily enough to highlight it as a battery, and saves adding gradients etc, that can become awkward if the logo is ever used in printing. Bob While I agree with you on the printing issue, I believe that we can use separate logos for web use (perhaps with gradients, depending on what others think) and another logo for printing. After all, one can argue that any colours apart from greyscale ones are non-optimal for printing as well, but that will not stop anyone from making a colourful logo. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
2009/6/11 Thomas Davie tom.da...@gmail.com: We had a lot of fun deciding Haskell's new logo, and while I don't agree with the final result, it would be nice if we could now start consistently using it. With that in mind, I realised that the Haskell Platform's logo is totally different, and did a quick mock up of a version reflecting the current Haskell logo. It needs someone with the original vector graphics to have a play and improve it a little bit, but hopefully you'll se a concept you like. Here's the logo, continuing on the batteries included theme: http://www.cs.kent.ac.uk/people/rpg/tatd2/HaskellBatteries.png I'd appreciate comments, suggestions, and possibly either access to the vector version of our current logo, or someone producing a nice version of this. Bob I love this suggestion! Maybe we should make the batteries look more battery-ish though. I think that especially the minus sign is a bit unclear, so maybe we could make the signs heavier? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Change value of a variable
2009/6/7 ptrash ptr...@web.de: Hi, thanks for the answers. I want to make something like a counter. I have written a recursive method which for example runs x times and counts how many times it runs, and also count some other thinks. Add the end I want a statistic about certain thinks returned by the method. Depending on exactly what you want, you may or may not want to look into monads, specifically the State or Writer monad. Could you give some more specific details on what you are trying to accomplish? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Floating instance and pi
2009/5/29 Paul Keir pk...@dcs.gla.ac.uk: Hi, I'd like to make my ADT an instance of the Floating class, but I'm not sure what to put for pi, and GHC gives a warning without it: Warning: No explicit method nor default method for `GHC.Float.pi' I tried setting it to undefined, but that gives an error: `pi' is not a (visible) method of class `Floating' Any idea? Paul Are you sure that your ADT fits into the Floating class in the first place? I reckon if it did, defining pi for it wouldn't be a problem. Could you show us the code you have? -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why is Bool no instance of Num and Bits?
2009/5/8 Stephan Friedrichs deduktionstheo...@web.de: Hi! When looking for an xor function, I found one in Data.Bits but couldn't use it for Bool, because Bool is no instance of Bits and of Num (which would be necessary, because it's class (Num b) = Bits b). My question is: Why not? We could declare instance Num Bool where (+) False = id (+) True = not (*) True True = True (*) _ _ = False (-) = (+) negate = id abs = id signum = const True fromInteger = not . even which basically implements the field with 2 elements and instance Bits Bool where bitSize = const 1 isSigned = const False (..) = () (.|.) = (||) xor = (+) complement = not shift = const shiftL = const shiftR = const rotate = const rotateL = const rotateR = const bit = (==0) setBit _ 0 = True setBit b _ = b clearBit _ 0 = False clearBit b _ = b complementBit b 0 = not b complementBit b _ = b testBit b 0 = b testBit _ _ = False quite trivial... Why is this not part of base? Or am I missing something? //Stephan Isn't XOR for booleans (/=)? Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Foldable for BNFC generated tree
2009/5/4 Martijn van Steenbergen mart...@van.steenbergen.nl: Hi Deniz, Deniz Dogan wrote: So, basically I'd like some sort of folding functionality for these data types, without having to hack the lexer/parser myself (parameterising the data types), because as I said they're being generated by BNFC. What exactly do you mean by folding functionality? Folding as in the Foldable type class applies to containers, which your data type isn't. Perhaps you're looking for generic programming? There are several good GP libraries out there: * EMGM: http://www.cs.uu.nl/wiki/GenericProgramming/EMGM * Uniplate: http://community.haskell.org/~ndm/uniplate/ * SYB: http://www.cs.vu.nl/boilerplate/ See also Neil Mitchell's blog for some examples: http://neilmitchell.blogspot.com/2009/03/concise-generic-queries.html You're right, what I was asking for didn't make much sense... I was really looking for GP. Thanks, Deniz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Foldable for BNFC generated tree
Hi I have a bunch of data types which are used to represent a JavaScript program. The data types and a lexer and a parser have all been generated using BNFC. So basically an entire JavaScript program is represented as a tree using these data types. Ideally I'd like to be able to fold over this data structure, but I can't instantiate Foldable for my data types, since the data types all have kind *, if I'm not completely lost. Here's an example data type: data Statement = StmtFunDecl JIdent [JIdent] ExprOrBlock | StmtVarDecl [VarDecl] | StmtLetDecl [VarDecl] | StmtWhile Expr Statement | ... So, basically I'd like some sort of folding functionality for these data types, without having to hack the lexer/parser myself (parameterising the data types), because as I said they're being generated by BNFC. I noticed that you can make BNFC generate GADTs instead of normal ADTs, which would allow me to instantiate Foldable, but I'm not entirely sure that this is the best way to do this. Any help is appreciated, Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell] ANNOUNCE: Haskell File Manager
2009/4/26 Michael Dever michael.dev...@mail.dcu.ie: Hi, The first release of Haskell File Manager has been uploaded to http://code.haskell.org/haskellfm This is a program for viewing/managing the files on your computer. It has all the common functionality you would expect from your current file manager, copying, moving, deleting, renaming, opening and searching. It is a beta release, so you know what to expect there, and any bugs found can be filed at http://trac.haskell.org/haskellfm . Cool! Are there any plans on making a console UI as well? -- Deniz Dogan ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: [Haskell-cafe] astronomy projects in haskell
2009/4/22 Michael Litchard mich...@schmong.org: I remember reading some website, that dons (probably) posted once. I'd like to find them again for a report I'm doing. So, if you know of any astronomy websites that talk about projects using haskell, please let me know. thanks Michael Litchard Could this be what you meant? http://www.absoluteastronomy.com/topics/Haskell_(programming_language) Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Haskell Logo Voting has started!
IANAL, so would this a problem if this logo won? Deniz 2009/3/19 Cetin Sert cetin.s...@gmail.com: 37Lenny222 Just noticed that this logo is way too similar to the logo of Techsmith: http://www.techsmith.com/ Regards, CS 2009/3/19 Eelco Lempsink ee...@lempsink.nl On 19 mrt 2009, at 11:39, Wolfgang Jeltsch wrote: Am Mittwoch, 18. März 2009 13:31 schrieben Sie: On Wed, Mar 18, 2009 at 04:36, Wolfgang Jeltsch wrote: Am Mittwoch, 18. März 2009 10:03 schrieb Benjamin L.Russell: Just go through the list, choose your top favorite, and assign rank 1 to it; Is rank 1 the best or the worst? The condorcet info page makes it clear that higher is better. http://www.cs.cornell.edu/w8/~andru/civs/rp.html So assigning rank 1 to my favorite, as Benjamin suggested, might not be the best idea. :-( I hope, everyone who voted did it the right way. Rank 1 is the best. A 'higher' rank doesn't mean a 'higher' number. Also see this poll http://www.cs.cornell.edu/w8/~andru/cgi-perl/civs/vote.pl?id=E_5820adef7d6e8733akey=51398305f80ae2cb -- Regards, Eelco Lempsink ___ 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] Re: Sugestion for a Haskell mascot
2009/3/12 Satnam Singh satn...@microsoft.com: I agree that looking for a mascot that is inspired by laziness is a bad idea from a P.R. perspective (I am tired of people walking out the room when I give Haskell talks to general audiences and explain lazy evaluation). Perhaps this is just an indication of my dark and violent side, but choosing an animal with a killer instinct might be a better idea. A creature that would eat something small and furry as a mid afternoon snack How about a viper? http://viperfashion.com/wp-content/uploads/2008/12/5742_coiled_up_viper_snake_sticking_tongue_out.jpg Python already uses a snake and it reminds me too much of vi and viper-mode etc. If so many people are reluctant towards the sloth, why don't we just go for the narwhal? They're predators, they have built-in swords and they're just bad ass in general. Then of course, there's the downside that there's no connection to the language itself in any way. Deniz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Sugestion for a Haskell mascot
2009/3/12 Colin Paul Adams co...@colina.demon.co.uk: Deniz == Deniz Dogan deniz.a.m.do...@gmail.com writes: Deniz 2009/3/12 Satnam Singh satn...@microsoft.com: I agree that looking for a mascot that is inspired by laziness is a bad idea from a P.R. perspective (I am tired of people walking out the room when I give Haskell talks to general audiences and explain lazy evaluation). Perhaps this is just an indication of my dark and violent side, but choosing an animal with a killer instinct might be a better idea. A creature that would eat something small and furry as a mid afternoon snack How about a viper? http://viperfashion.com/wp-content/uploads/2008/12/5742_coiled_up_viper_snake_sticking_tongue_out.jpg Deniz Python already uses a snake and it reminds me too much of Deniz vi and viper-mode etc. If so many people are reluctant Deniz towards the sloth, why don't we just go for the narwhal? Deniz They're predators, they have built-in swords and they're Deniz just bad ass in general. Then of course, there's the Deniz downside that there's no connection to the language itself Deniz in any way. Why not just dispense with a mascot? It's rather childish. New motto for Haskell: Avoid mascots at all cost. Let's have a vote about the official Haskell motto! Deniz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Against cuteness
2009/3/13 Benjamin L. Russell dekudekup...@yahoo.com: On Thu, 12 Mar 2009 09:11:15 -0500, Gregg Reynolds d...@mobileink.com wrote: [snip] Why even bother discussing whether a potential mascot should be cute or not? You guys should come up with new ideas instead of simply stating what you *don't* want. :) Deniz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[2]: [Haskell-cafe] Sugestion for a Haskell mascot
2009/3/11 minh thu not...@gmail.com: 2009/3/11 Bulat Ziganshin bulat.zigans...@gmail.com: Hello Wolfgang, Wednesday, March 11, 2009, 1:06:37 PM, you wrote: Hehe, I love it. Sloth is a synonym for Lazyness in English too, and they're so freaking cute... :) Same in German: The german “Faultier” means “lazy animal”. russian too, if that matter. i was really amazed by this idea. pure, lazy and fun! :) Same in french : 'paresseux' just means lazy. Thu In Swedish it translates to late walker (?) and in Turkish it's lazy animal. Deniz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Sugestion for a Haskell mascot
It's got my vote! 2009/3/10 Joe Fredette jfred...@gmail.com: Hehe, I love it. Sloth is a synonym for Lazyness in English too, and they're so freaking cute... :) Maurício wrote: Hi, Here in Brazil we have a forest animal we name 'preguiça' -- literally, lazyness. What better mascot we could have for Haskell? It lives (and sleeps) in trees, and if you see the main picture in wikipedia articles you can easily imagine the tree branch beeing replaced by a lambda: http://en.wikipedia.org/wiki/Sloth http://pt.wikipedia.org/wiki/Bicho-pregui%C3%A7a Best, Maurício ___ 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: Temporarily overriding Data.Generic
Hi Duncan 2009/2/5 Duncan Coutts duncan.cou...@worc.ox.ac.uk: On Thu, 2009-02-05 at 00:11 +0100, Deniz Dogan wrote: I'm currently working on hacking Data.Generics for my master thesis. I'm basically trying to find out whether it can be made any faster using e.g. rewrite rules. The problem I'm having is that I need an easy way to import my own modified version of Data.Generics (currently located in the same directory as my testing program) without unregistering or hiding syb-0.1.0.0 as base seems to depend on it. This should just work. If ./Data/Generics.hs exists in / relative to the current directory then by default that overrides the module of the same name from the syb package. There's clearly some specific problem you're hitting, can you tell us more about it? You're right of course, it does work. I must have been so convinced it wouldn't work that I completely disregarded that GHC even told me it compiled Data.Generics and all of the other modules. That was silly! Thanks! ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] Re: Haskell tutorial for pseudo users?
2009/2/6 Jonathan Cast jonathancc...@fastmail.fm: Emacs' terminal is also lacking all the modern conveniences, like addressable cursors and builtin line-editing designed for 1970s printing terminals and practically no searching capabilities. Alternatively, you could say it's incompatible with modern Unix's biggest mistakes and worst legacy issues. With the risk of making this even more OT: Emacs has three different types of shells built-in, at least to my knowledge. These are M-x shell, eshell and term. I'm not sure which one you are referring to as Emacs' terminal, if any of them, but inf-haskell.el uses shell afaics. And what do you mean with no searching capabilites? What kind of searching are we talking here? Deniz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Temporarily overriding Data.Generic
Sorry for those who receive this who have already gotten it from haskell-cafe. --- Hi I'm currently working on hacking Data.Generics for my master thesis. I'm basically trying to find out whether it can be made any faster using e.g. rewrite rules. The problem I'm having is that I need an easy way to import my own modified version of Data.Generics (currently located in the same directory as my testing program) without unregistering or hiding syb-0.1.0.0 as base seems to depend on it. I've read the GHC user manual trying to find nice ways to do this using a bunch of different parameters to ghc, but I can't figure it out. Does anyone here know? Any help appreciated, Deniz ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell-cafe] Temporarily overriding Data.Generics
Hi I'm currently working on hacking Data.Generics for my master thesis. I'm basically trying to find out whether it can be made a bit faster using e.g. rewrite rules. The problem I'm having is that I need an easy way to import my own modified version of Data.Generics (currently located in the same directory as my testing program) without unregistering or hiding syb-0.1.0.0 as base seems to depend on it. I've read the GHC user manual trying to find nice ways to do this using a bunch of different parameters to ghc, but I can't figure it out. Does anyone here know? Any help appreciated, Deniz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell tutorial for pseudo users?
2009/2/2 Emil Axelsson e...@chalmers.se: Hello, Are there any Haskell tutorials suitable for people who don't (and possibly don't want to) know Haskell, but just want to use an embedded language that happens to be in Haskell? Such a tutorial would focus on using libraries rather than defining them. For example, it might explain how to interpret a type signature involving type classes, but not how to write one's own type class. Thanks, / Emil Hi, Emil I don't think it's a good idea (or even possible) to use a Haskell library without knowing anything about Haskell or functional programming. However, it shouldn't take too long to learn the very basics needed to get going, but this of course depends on the complexity of the library you're trying to use. Take some the time to read the parts that are relevant to you in e.g. Learn You a Haskell for Great Good (http://learnyouahaskell.com/) or Real World Haskell which has been published in book form, but is also available at http://book.realworldhaskell.org. If you haven't already taken the course Introduction to Functional Programming given at Chalmers, you can take a look at the lecture slides and/or exercises/labs from the course at http://www.cs.chalmers.se/Cs/Grundutb/Kurser/funht/. I hope that helps. Deniz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe