From jeffbrown.the at gmail.com Mon Dec 1 00:52:41 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Sun, 30 Nov 2014 16:52:41 -0800 Subject: [Haskell-cafe] installation problems: wx, phooey, checkers Message-ID: I believe I have wxWidgets installed, because when I go to the demos/ or samples/ subfolders of ~/wxWidgets-3.0.2/build-cocoa-debug/, I can run the apps. Now I want to install the phooey library for Haskell. When I try, I am warned that some things will be broken, so I unregister them and then cabal install them all at once. (The complete output from my session with cabal appears below.) I run cabal from ~/wxWidgets, because that folder contains the files wx-config-inplace.in wx-config.in and I know cabal wants wx-config. The two errors I get: wx-config is not found checkers does not install I am left stumped. Thanks for your help. -------------------- jefferys-mbp:~ jbb$ cd wxWidgets-3.0.2/ jefferys-mbp:wxWidgets-3.0.2 jbb$ cabal install phooey Resolving dependencies... In order, the following would be installed: mtl-1.1.1.1 (latest: 2.2.1) (new version) parsec-3.1.7 (reinstall) changes: mtl-2.2.1 -> 1.1.1.1 reactive-0.5.0.1 (latest: 0.11.5) (new package) wxdirect-0.91.0.0 (reinstall) wxc-0.91.0.0 (new package) wxcore-0.91.0.0 (new package) wx-0.91.0.0 (new package) phooey-2.0.0.1 (new package) cabal: The following packages are likely to be broken by the reinstalls: tidal-0.4.21 network-uri-2.6.0.1 threepenny-gui-0.5.0.0 hmt-0.15 Use --force-reinstalls if you want to install anyway. jefferys-mbp:wxWidgets-3.0.2 jbb$ ghc-pkg unregister tidal jefferys-mbp:wxWidgets-3.0.2 jbb$ ghc-pkg unregister threepenny-gui jefferys-mbp:wxWidgets-3.0.2 jbb$ ghc-pkg unregister network-uri jefferys-mbp:wxWidgets-3.0.2 jbb$ ghc-pkg unregister hmt jefferys-mbp:wxWidgets-3.0.2 jbb$ cabal install tidal network-uri threepenny-gui hmt phooey Resolving dependencies... Configuring checkers-0.1.4... Configuring network-uri-2.6.0.1... Configuring hmt-0.15... Configuring wxc-0.91.0.0... Building network-uri-2.6.0.1... Building checkers-0.1.4... Building hmt-0.15... Failed to install checkers-0.1.4 Last 10 lines of the build log ( /Users/jbb/.cabal/logs/checkers-0.1.4.log ): at src/Test/QuickCheck/Instances/Num.hs:23:12-49 Possible fix: add (Eq a) to the context of the type signature for nonZero :: (Num a, Arbitrary a) => Gen a -> Gen a In the first argument of ?satisfiesM?, namely ?(/= 0)? In the expression: satisfiesM (/= 0) (if (s == 0) then (resize 1 g) else g) In the first argument of ?sized?, namely ?(\ s -> satisfiesM (/= 0) (if (s == 0) then (resize 1 g) else g))? Failed to install wxc-0.91.0.0 Last 10 lines of the build log ( /Users/jbb/.cabal/logs/wxc-0.91.0.0.log ): [1 of 1] Compiling Main ( /var/folders/q1/2_cf13z53tg__sqdk7v8ycgm0000gn/T/wxc-0.91.0.0-41510/wxc-0.91.0.0/Setup.hs, /var/folders/q1/2_cf13z53tg__sqdk7v8ycgm0000gn/T/wxc-0.91.0.0-41510/wxc-0.91.0.0/dist/setup/Main.o ) Linking /var/folders/q1/2_cf13z53tg__sqdk7v8ycgm0000gn/T/wxc-0.91.0.0-41510/wxc-0.91.0.0/dist/setup/setup ... Error: wx-config not found, please install wx-config before installing wxc Installed network-uri-2.6.0.1 Configuring threepenny-gui-0.5.0.0... Building threepenny-gui-0.5.0.0... Installed threepenny-gui-0.5.0.0 Installed hmt-0.15 Configuring tidal-0.4.21... Building tidal-0.4.21... Installed tidal-0.4.21 Updating documentation index /Users/jbb/Library/Haskell/share/doc/index.html cabal: Error: some packages failed to install: checkers-0.1.4 failed during the building phase. The exception was: ExitFailure 1 phooey-2.0 depends on wxc-0.91.0.0 which failed to install. reactive-0.9.3 depends on checkers-0.1.4 which failed to install. wx-0.91.0.0 depends on wxc-0.91.0.0 which failed to install. wxc-0.91.0.0 failed during the configure step. The exception was: ExitFailure 1 wxcore-0.91.0.0 depends on wxc-0.91.0.0 which failed to install. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fa-ml at ariis.it Mon Dec 1 01:34:43 2014 From: fa-ml at ariis.it (Francesco Ariis) Date: Mon, 1 Dec 2014 02:34:43 +0100 Subject: [Haskell-cafe] [haskell art] Music made with Haskell In-Reply-To: References: Message-ID: <20141201013443.GA32669@x60s.casa> On Fri, Nov 28, 2014 at 12:47:48PM +0400, Anton Kholomiov wrote: > I wrote two tracks completely with Haskell. > You can listen to them on the soundcloud: I finally listened to them, enjoyed the pieces very much, especially the soothing "Ocean". The code of the songs is slender and understandable too, which says a lot about the expressiveness of the library. Hope to hear more from you! -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From yasu at yasuaki.com Mon Dec 1 02:10:04 2014 From: yasu at yasuaki.com (Yasuaki Kudo) Date: Mon, 1 Dec 2014 11:10:04 +0900 Subject: [Haskell-cafe] Typeclass Show Question In-Reply-To: References: <008201d00cf9$1aca4d00$505ee700$@yasuaki.com> Message-ID: <00b301d00d0b$ee286350$ca7929f0$@yasuaki.com> Thank you so much; this worked! :) From: Kai Zhang [mailto:kai at kzhang.org] Sent: Monday, December 1, 2014 08:59 To: Yasuaki Kudo Cc: Haskell Cafe Subject: Re: [Haskell-cafe] Typeclass Show Question The type "a" in S a b must be an instance of "Show" in order to use "show". So you need: instance Show a => Show (S a b) where show (S x y) = show x On Sun, Nov 30, 2014 at 3:55 PM, Yasuaki Kudo > wrote: Hi, When I launch GHCI with the option ?XGADTs and load the following program, f = \x y -> (1, x,y) data S a b where S :: (Num a, Num b) => a -> b -> S a b I encounter this dialog: *Main> S 1 1 :3:1: No instance for (Show (S a0 b0)) arising from a use of `print' Possible fix: add an instance declaration for (Show (S a0 b0)) In a stmt of an interactive GHCi command: print it I tried to follow the recommendation but still could not figure out how. For example, after adding: instance Show (S a b) where show (S x y) = show(x) I still get: conmath.hs:10:24: Could not deduce (Show a) arising from a use of `show' from the context (Num a, Num b) bound by a pattern with constructor S :: forall a b. (Num a, Num b) => a -> b -> S a b, in an equation for `show' at conmath.hs:10:15-19 Possible fix: add (Show a) to the context of the data constructor `S' or the instance declaration In the expression: show (x) In an equation for `show': show (S x y) = show (x) In the instance declaration for `Show (S a b)' Failed, modules loaded: none. What should I do to show S 1 1 ? Regards, Yasu _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe at haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok at cs.otago.ac.nz Mon Dec 1 02:18:35 2014 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Mon, 1 Dec 2014 15:18:35 +1300 Subject: [Haskell-cafe] Haskell 2014 In-Reply-To: <54EA2BCB-7F32-42C6-9D09-14346EBAAAF5@gmail.com> References: <137871417313010@web12h.yandex.ru> <547B03AD.2070101@ro-che.info> <491361417350555@web22g.yandex.ru> <547B30EC.6070405@ro-che.info> <54EA2BCB-7F32-42C6-9D09-14346EBAAAF5@gmail.com> Message-ID: <6320D9A1-6C76-4DD2-AC50-1401FF489A7A@cs.otago.ac.nz> I did some consulting for a company once before the ISO Prolog standard came out and they said they had a corporate policy of never using _anything_ that didn?t have a recognised standard. I have no reason to suppose them unique. From jeffbrown.the at gmail.com Mon Dec 1 03:03:37 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Sun, 30 Nov 2014 19:03:37 -0800 Subject: [Haskell-cafe] How to update Cabal manually? Message-ID: "cabal install cabal-install" is not working for me. I am not the first to find this problem; it is mentioned here : "Notice, that in some cases (OS X, especially) the new cabal-install might not be installed on top of the previous one, and the old cabal-install must be replaced manually" I don't know how to manually replace Cabal. The closest thing I could find to instructions for that were here , but I don't understand them. The Haskell Platform installer is what installed Cabal for me. I have not found how to undo that, nor how to install Cabal in any other fashion. Running the Haskell Platform installer again seems dangerous, potentially conflicting with its earlier work. A likely unnecessary shell transcript demonstrating the problem appears below. I am running OS X 10.9 on a MacBook Pro, of which the decision to purchase I regret more daily. Thank you. ----- When I try to update cabal, it looks like it works: jefferys-mbp:~ jbb$ cabal install cabal-install Resolving dependencies... Configuring cabal-install-1.20.0.3... Building cabal-install-1.20.0.3... Installed cabal-install-1.20.0.3 Updating documentation index /Users/jbb/Library/Haskell/share/doc/index.html But the version number exhibits no change: jefferys-mbp:~ jbb$ cabal --version cabal-install version 1.18.0.5 using version 1.18.1.4 of the Cabal library -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmartin at eecs.berkeley.edu Mon Dec 1 03:12:18 2014 From: jmartin at eecs.berkeley.edu (James M) Date: Sun, 30 Nov 2014 19:12:18 -0800 Subject: [Haskell-cafe] How to update Cabal manually? In-Reply-To: References: Message-ID: Check your PATH environment variable and make sure that the directory it is installed in appears first in the list. I believe the default installation directory for OS X is: ~/Library/Haskell/bin To have OS X use the latest cabal (without overwriting anything), you can do something like this in your login script (default login script is .bash_profile): export PATH=$HOME/Library/Haskell/bin:$PATH James On Sun, Nov 30, 2014 at 7:03 PM, Jeffrey Brown wrote: > "cabal install cabal-install" is not working for me. I am not the first to > find this problem; it is mentioned here > : > > "Notice, that in some cases (OS X, especially) the new cabal-install might > not be installed on top of the previous one, and the old cabal-install must > be replaced manually" > > I don't know how to manually replace Cabal. The closest thing I could find > to instructions for that were here > , > but I don't understand them. > > The Haskell Platform installer is what installed Cabal for me. I have not > found how to undo that, nor how to install Cabal in any other fashion. > Running the Haskell Platform installer again seems dangerous, potentially > conflicting with its earlier work. > > A likely unnecessary shell transcript demonstrating the problem appears > below. > > I am running OS X 10.9 on a MacBook Pro, of which the decision to purchase > I regret more daily. > > Thank you. > > ----- > > When I try to update cabal, it looks like it works: > > jefferys-mbp:~ jbb$ cabal install cabal-install > Resolving dependencies... > Configuring cabal-install-1.20.0.3... > Building cabal-install-1.20.0.3... > Installed cabal-install-1.20.0.3 > Updating documentation index > /Users/jbb/Library/Haskell/share/doc/index.html > > But the version number exhibits no change: > > jefferys-mbp:~ jbb$ cabal --version > cabal-install version 1.18.0.5 > using version 1.18.1.4 of the Cabal library > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eir at cis.upenn.edu Mon Dec 1 03:26:00 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Sun, 30 Nov 2014 22:26:00 -0500 Subject: [Haskell-cafe] Kind product In-Reply-To: References: Message-ID: On Nov 30, 2014, at 5:38 PM, Gautier DI FOLCO wrote: > > Thanks for your answer. > I don't see why it's closer to dependent typing, can you give me some hints? One of the steps to dependent typing in Haskell (as my research partners and I see it) is making the type level and the kind level uniform -- that is, to stop distinguishing types from kinds. Thus, since we have type families, we must have kind families as well. The uniformity between the levels makes it easier to promote more data constructors to type constructors. I agree with the implied opinion that kind families have little to do with types depending on values. Richard From benl at ouroborus.net Mon Dec 1 03:56:25 2014 From: benl at ouroborus.net (Ben Lippmeier) Date: Mon, 1 Dec 2014 14:56:25 +1100 Subject: [Haskell-cafe] Haskell 2014 In-Reply-To: <6320D9A1-6C76-4DD2-AC50-1401FF489A7A@cs.otago.ac.nz> References: <137871417313010@web12h.yandex.ru> <547B03AD.2070101@ro-che.info> <491361417350555@web22g.yandex.ru> <547B30EC.6070405@ro-che.info> <54EA2BCB-7F32-42C6-9D09-14346EBAAAF5@gmail.com> <6320D9A1-6C76-4DD2-AC50-1401FF489A7A@cs.otago.ac.nz> Message-ID: <0BDA1054-9609-452C-92B4-923B6BAA841E@ouroborus.net> "ISO Standardisation is the kiss of death" -- guess who? Ben. On 1 Dec 2014, at 13:18 , Richard A. O'Keefe wrote: > I did some consulting for a company once before the ISO Prolog standard came > out and they said they had a corporate policy of never using _anything_ that > didn?t have a recognised standard. I have no reason to suppose them unique. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From ok at cs.otago.ac.nz Mon Dec 1 05:01:52 2014 From: ok at cs.otago.ac.nz (ok at cs.otago.ac.nz) Date: Mon, 1 Dec 2014 18:01:52 +1300 Subject: [Haskell-cafe] Haskell 2014 In-Reply-To: <0BDA1054-9609-452C-92B4-923B6BAA841E@ouroborus.net> References: <137871417313010@web12h.yandex.ru> <547B03AD.2070101@ro-che.info> <491361417350555@web22g.yandex.ru> <547B30EC.6070405@ro-che.info> <54EA2BCB-7F32-42C6-9D09-14346EBAAAF5@gmail.com> <6320D9A1-6C76-4DD2-AC50-1401FF489A7A@cs.otago.ac.nz> <0BDA1054-9609-452C-92B4-923B6BAA841E@ouroborus.net> Message-ID: > > "ISO Standardisation is the kiss of death" -- guess who? I don't know, and at this point I don't greatly care. What counts is whether it is _true_. The existence of ISO standards for C, C++, C#, and Javascript does not seem to have resulted in the death of those languages. Nor, despite Microsoft's probable hopes, has ISO/IEC/IEEE 9945:2008 resulted in the death of Unix. And the kiss of ISO standardisation does not seem to have even slowed the Unicode monster down. (Where isJirel of Joiry when you need her?) Some standardisation efforts may be a bad thing. The path to ISO Prolog was marred by years of NIH bike-shedding which made it years late and still has not resulted in as much convergence as those who sweated blood on it would wish. It's not necessarily ISO that is the problem. The ANSI Smalltalk standard with its inconsistencies and sloppy proof-reading appears to have been a dead letter from its birth. 16 years later and I *still* cannot expect a simple thing like opening a file to work the same in the eight Smalltalk systems I have. What counts for the development and growth of a programming language is the community behind it, and Haskell is blessed with some really amazing people. However, it remains true that some companies expect to outlive their suppliers, and that the existence of a standard gives them some confidence that avoiding things outside it will reduce their risks. That's all. From gonzaw308 at gmail.com Mon Dec 1 06:04:36 2014 From: gonzaw308 at gmail.com (gonzaw) Date: Sun, 30 Nov 2014 23:04:36 -0700 (MST) Subject: [Haskell-cafe] Haskell in the "Enterprise" Message-ID: <1417413876897-5761538.post@n5.nabble.com> Hi. I've been wondering if there are any plans or projects to bring Haskell to the "enterprise" ecosystem An by this I mean allowing applications made in Haskell (and other languages) to be integrated in a distributed fashion, easily being able to integrate different systems (DBMSs, web services, etc), etc. For example, creating an ESB in Haskell to allow easier integration of distributed applications. We all worked (or know someone who worked) with huge Java/IBM/etc enterprise systems, and know how clunky the experience was. Being able to include Haskell in this ecosystem would be so refreshing. I was also wondering if there is any research going on on how to apply the mathematical concepts and FP principles behind Haskell to these enterprise constructs. For instance, how to apply FP and category theory to Enterprise Application Integration to make scalable, robust and composable systems that are actually easy to use and discover. For example, I always had this idea of having "pure Web Services" and "effectful Web Services" as different protocols that can be used in different ways depending on the service being provided. Or maybe allowing functions to be passed as parameters in web services, by defining a small typed lambda calculus that can be serialized to XML and passed in a SOAP message (with the appropriate interpreters in the client+server). The ideas never went beyond that, but they sparked my interest in this sort of thing. To start somewhere, are there any Haskell libraries with Web Service support? Like a WS client tools (SOAP messaging DSL + WSDL import tool)? Or a haskell library that allows one to provide web services (and maybe provide the WS-* extensions)? -- View this message in context: http://haskell.1045720.n5.nabble.com/Haskell-in-the-Enterprise-tp5761538.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. From suhailshergill at gmail.com Mon Dec 1 06:14:40 2014 From: suhailshergill at gmail.com (Suhail Shergill) Date: Mon, 01 Dec 2014 06:14:40 +0000 Subject: [Haskell-cafe] extensible effects and open unions In-Reply-To: (adam vogt's message of "Sat, 29 Nov 2014 15:29:56 -0500") References: <20130823080608.45461.qmail@www1.g3.pair.com> <87h9xjzm7t.fsf_-_@chaos.shergill.su> Message-ID: <8761dvzyjz.fsf@chaos.shergill.su> adam vogt writes: > You need to write an instance of TCode for every different "effect" > included in the union for the lookup to work. > ... thanks for the explanation; the Includes instances make more sense now > I think you're better off depending on a > > type family Eq :: Bool where > Eq x x = True > Eq x y = False > > Or the equivalent with overlapping instances if the code is supposed > to work with ghc-7.6. yes, i've updated the code on hackage to fall back on the overlapping instances implementation for ghc-7.6 > Another objection about TList is that it is a linked list, so operations with > types at the "end" of the union are probably relatively slow at runtime, since > you end up pattern matching on "n" T constructors in some cases. that may just be a limitation for the code being written for ghc-7.4 iiuc > It might be faster to have more of that traversal done at compile time as in: > > http://code.haskell.org/HList/Data/HList/Variant.hs thanks for the additional reference. i've been meaning to read up on HList; perhaps this will be my segue > Or with unions that use Typeable. actually with Typeable being kind polymorphic in ghc-7.8, the improved deriving code, -XAutoDeriveTypeable and -XStandaloneDeriving i don't see much of a drawback with the above approach. > I'm not sure about your other questions. yes, they were more directed at oleg (in the cc), but figured others might have made their way through these waters before me, so it couldn't hurt to ask. cheers -- Suhail From dominic at steinitz.org Mon Dec 1 09:30:50 2014 From: dominic at steinitz.org (Dominic Steinitz) Date: Mon, 1 Dec 2014 09:30:50 +0000 Subject: [Haskell-cafe] Julia and Charts on Mac Message-ID: <73585950-B269-49FC-998E-188891402644@steinitz.org> I just had an interesting experience installing the Julia charts package (Gadfly based on ggplot) on my Mac which I thought I would share as I know I and other folk have had trouble getting diagrams / Cairo to work on Macs. It installs homebrew and then all the required packages from its own repo (not sure what the homebrew terminology is for this - possibly a brewery?) so presumably guaranteeing that the installation is consistent and ?just works?. I must say I was a bit surprised (I think I would have liked it to tell me what it was about to do) but it was entirely painless and I drew my first chart after less than 5 minutes. Something to bear in mind for making the barrier to entry to Haskell a bit lower. Dominic Steinitz dominic at steinitz.org http://idontgetoutmuch.wordpress.com PS I am not sure that haskell-cafe is the right list to share this on but as we don?t have a mailing list for numerical stuff or mac stuff... From hjgtuyl at chello.nl Mon Dec 1 09:59:39 2014 From: hjgtuyl at chello.nl (Henk-Jan van Tuyl) Date: Mon, 01 Dec 2014 10:59:39 +0100 Subject: [Haskell-cafe] installation problems: wx, phooey, checkers In-Reply-To: References: Message-ID: On Mon, 01 Dec 2014 01:52:41 +0100, Jeffrey Brown wrote: > I believe I have wxWidgets installed, because when I go to the demos/ or > samples/ subfolders of ~/wxWidgets-3.0.2/build-cocoa-debug/, I can run > the > apps. Now I want to install the phooey library for Haskell. When I try, I > am warned that some things will be broken, so I unregister them and then > cabal install them all at once. (The complete output from my session with > cabal appears below.) > > I run cabal from ~/wxWidgets, because that folder contains the files > wx-config-inplace.in > wx-config.in > and I know cabal wants wx-config. > > The two errors I get: > wx-config is not found > checkers does not install > > I am left stumped. Thanks for your help. Does your system search the working directory for executables? If not, try: PATH=.:$PATH Regards, Henk-Jan van Tuyl Haskell programming -- Folding at home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html -- From jonathan.erwin at inchora.com Mon Dec 1 11:09:17 2014 From: jonathan.erwin at inchora.com (jonathan.erwin) Date: Mon, 1 Dec 2014 11:09:17 +0000 Subject: [Haskell-cafe] Passionate About Using Haskell? In-Reply-To: <5f7e9f9130ec408384119a0f53419bc4@DB4PR06MB095.eurprd06.prod.outlook.com> References: <5f7e9f9130ec408384119a0f53419bc4@DB4PR06MB095.eurprd06.prod.outlook.com> Message-ID: Dear Haskellers, I am looking for developers passionate about using Haskell on the job to join my engineering team based in Norwich, Norfolk. About Us: ? Inchora Ltd (http://www.inchora.com) is privately funded with a clear growth plan for the next 5 years. Our business model revolves around developing products and distributing them with our own marketing assets. ? Our products are diverse and serve multiple industries including utilities, local government, online marketing and finance. You will be working across them all. The Role: ? We're looking for experienced developers who have previously worked on commercial software projects (even if they were written in C++ or Java...). ? Work from the Norwich office on a permanent basis developing applications using Haskell, MongoDB, Heroku and other goodies. ? Help document and subsequently unify the code base of at least 5 different product suites all suffering from delirious imperative code. ? Salary of ?45,000-?60,000 (plus bonus) depending on experience. The Perks ? Norfolk is a real ale Mecca. Seriously there is so much good beer we have a festival every October. ? We love FP! We want to show the world what applications written in Haskell can do. ? Build your own products or tinker with them in our lab (coming 2015). If it's a great idea, we'll back it with real money as part of our accelerator programme. Any questions? Ready to join? My number is below. Give me a ring! Sincerely, Jonathan Erwin Chief Technical Officer M: 07833 254186 | DDI: 0845 6432371 [inchora-logo-email] Inchora Limited - Quatro House, Lyon Way, Frimley, Surrey, GU16 7ER www.inchora.com | 01276 804400 This email and any attachments may be legally privileged and are confidential, protected by copyright and for the addressee only. We have taken reasonable steps to reduce risks against viruses but cannot accept liability for any damages sustained as a result of this transmission. If you are not the intended receiver, any reading, copying or transmission of this email is prohibited. Please tell us by replying to this email and then delete the email from your system. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 12181 bytes Desc: image002.png URL: From anton.kholomiov at gmail.com Mon Dec 1 13:01:25 2014 From: anton.kholomiov at gmail.com (Anton Kholomiov) Date: Mon, 1 Dec 2014 17:01:25 +0400 Subject: [Haskell-cafe] [haskell art] Music made with Haskell In-Reply-To: <20141201013443.GA32669@x60s.casa> References: <20141201013443.GA32669@x60s.casa> Message-ID: Thanks for the kind words. It was a long road to making the tracks 2014-12-01 4:34 GMT+03:00 Francesco Ariis : > ? Attachment links are at the end of this email ? > > On Fri, Nov 28, 2014 at 12:47:48PM +0400, Anton Kholomiov wrote: > > I wrote two tracks completely with Haskell. > > You can listen to them on the soundcloud: > > I finally listened to them, enjoyed the pieces very much, especially > the soothing "Ocean". The code of the songs is slender and understandable > too, which says a lot about the expressiveness of the library. > Hope to hear more from you! > Haskell Art now contains the following file > > http://lurk.org/r/file/nFZV4c8qtpakhypQ8qLsZLbNvOh-du-2uIm3Mv > Name: > Type: application/pgp-signature > Size: 0KB > > > -- > > Read the whole topic here: Haskell Art: > http://lurk.org/r/topic/5IjFl1XM22QwKsJmkDUlFz > > To leave Haskell Art, email haskell-art at group.lurk.org with the following > email subject: unsubscribe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hjgtuyl at chello.nl Mon Dec 1 13:06:30 2014 From: hjgtuyl at chello.nl (Henk-Jan van Tuyl) Date: Mon, 01 Dec 2014 14:06:30 +0100 Subject: [Haskell-cafe] Getting Haskell in the top 20 In-Reply-To: <547B55DE.1010104@mcmaster.ca> References: <547B55DE.1010104@mcmaster.ca> Message-ID: Using the words "Haskell" and "programming" in emails probably helps getting Haskell a few places up, but I think there is much more needed to get it in the top twenty. Things like a GHC backend that produces Java bytecode and/or Common Intermediate Language, commercial support, or Microsoft delivering Haskell in a Visual Studio environment. These are things that will raise much more interest in Haskell in the commercial world, and therefore would also interest more programmers. Regards, Henk-Jan van Tuyl On Sun, 30 Nov 2014 18:37:34 +0100, Jacques Carette wrote: > Make sure the actual words "Haskell programming" occur in as many places > as possible [posts here, on reddit, on stackoverflow, etc]. Not > variants of those words, but those exact words. Like you did in your > .sig (although that may not be indexed, so it may need to be in the > actual text). > > Get it into people's phrasing that they always speak of "Haskell > programming", not Haskell code, coding, etc, etc. > > Jacques > > On 2014-11-30 11:29 AM, Henk-Jan van Tuyl wrote: >> >> L.S., >> >> In the Tiobe Index[0], F# jumped from position 43 in June to 13 in July >> and is since than in the >> top twenty. What happened in July and how can we get Haskell in the top >> 20? >> >> Regards, >> Henk-Jan van Tuyl >> >> >> [0] http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html -- Folding at home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming -- From david.feuer at gmail.com Mon Dec 1 14:25:19 2014 From: david.feuer at gmail.com (David Feuer) Date: Mon, 1 Dec 2014 09:25:19 -0500 Subject: [Haskell-cafe] Haskell 2014 In-Reply-To: References: <137871417313010@web12h.yandex.ru> <547B03AD.2070101@ro-che.info> <491361417350555@web22g.yandex.ru> <547B30EC.6070405@ro-che.info> <54EA2BCB-7F32-42C6-9D09-14346EBAAAF5@gmail.com> <6320D9A1-6C76-4DD2-AC50-1401FF489A7A@cs.otago.ac.nz> <0BDA1054-9609-452C-92B4-923B6BAA841E@ouroborus.net> Message-ID: On Mon, Dec 1, 2014 at 12:01 AM, wrote: > What counts for the development and growth of a programming > language is the community behind it, and Haskell is blessed > with some really amazing people. > Most of those amazing people care more about keeping the language growing than about rigid adherence to a standard or complete backwards compatibility. > However, it remains true that some companies expect to > outlive their suppliers, and that the existence of a > standard gives them some confidence that avoiding things > outside it will reduce their risks. That's all. > Since all Haskell implementations of any significance, historical or otherwise, are open source, this is a red herring. If the GHC project dies, anyone relying on GHC is free to continue development themselves. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Mon Dec 1 14:31:57 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Mon, 1 Dec 2014 14:31:57 +0000 Subject: [Haskell-cafe] ANN: Opaleye -- SQL-generating embedded domain specific language for Postgres Message-ID: <20141201143157.GJ11464@weber> I am pleased to announce the public release of Opaleye, now available on Hackage and at GitHub: http://hackage.haskell.org/package/opaleye https://github.com/tomjaguarpaw/haskell-opaleye Opaleye is a Haskell library which provides an SQL-generating embedded domain specific language for targeting Postgres. You need Opaleye if you want to use Haskell to write typesafe and composable code to query a Postgres database. Opaleye allows you to define your database tables and write queries against them in Haskell code, and aims to be typesafe in the sense that if your code compiles then the generated SQL query will not fail at runtime. A wide range of SQL functionality is supported including inner and outer joins, restriction, aggregation, distinct, sorting and limiting, unions and differences. Facilities to insert to, update and delete from tables are also provided. Code written using Opaleye is composable at a very fine level of granularity, promoting code reuse and high levels of abstraction. For further information please refer to the README and tutorials: https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/README.md https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/Doc/Tutorial/TutorialBasic.lhs https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/Doc/Tutorial/TutorialManipulation.lhs I would be happy to answer any questions anyone might have about this library. Tom From chpatrick at gmail.com Mon Dec 1 14:50:50 2014 From: chpatrick at gmail.com (Patrick Chilton) Date: Mon, 1 Dec 2014 14:50:50 +0000 Subject: [Haskell-cafe] Haskell 2014 In-Reply-To: References: <137871417313010@web12h.yandex.ru> <547B03AD.2070101@ro-che.info> <491361417350555@web22g.yandex.ru> <547B30EC.6070405@ro-che.info> <54EA2BCB-7F32-42C6-9D09-14346EBAAAF5@gmail.com> <6320D9A1-6C76-4DD2-AC50-1401FF489A7A@cs.otago.ac.nz> <0BDA1054-9609-452C-92B4-923B6BAA841E@ouroborus.net> Message-ID: Even if there's not much interest in a new standard, is there any hope for turning on "benign" language extensions by default anytime soon? It seems like unnecessary boilerplate. Patrick On Mon, Dec 1, 2014 at 2:25 PM, David Feuer wrote: > On Mon, Dec 1, 2014 at 12:01 AM, wrote: > >> What counts for the development and growth of a programming >> language is the community behind it, and Haskell is blessed >> with some really amazing people. >> > > Most of those amazing people care more about keeping the language growing > than about rigid adherence to a standard or complete backwards > compatibility. > > >> However, it remains true that some companies expect to >> outlive their suppliers, and that the existence of a >> standard gives them some confidence that avoiding things >> outside it will reduce their risks. That's all. >> > > Since all Haskell implementations of any significance, historical or > otherwise, are open source, this is a red herring. If the GHC project dies, > anyone relying on GHC is free to continue development themselves. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Mon Dec 1 14:58:00 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Mon, 1 Dec 2014 14:58:00 +0000 Subject: [Haskell-cafe] Haskell 2014 In-Reply-To: References: <137871417313010@web12h.yandex.ru> <547B03AD.2070101@ro-che.info> <491361417350555@web22g.yandex.ru> <547B30EC.6070405@ro-che.info> <54EA2BCB-7F32-42C6-9D09-14346EBAAAF5@gmail.com> <6320D9A1-6C76-4DD2-AC50-1401FF489A7A@cs.otago.ac.nz> <0BDA1054-9609-452C-92B4-923B6BAA841E@ouroborus.net> Message-ID: <20141201145800.GK11464@weber> On Mon, Dec 01, 2014 at 02:50:50PM +0000, Patrick Chilton wrote: > Even if there's not much interest in a new standard, is there any hope for > turning on "benign" language extensions by default anytime soon? It seems > like unnecessary boilerplate. Specifying extensions in the cabal file is still boilerplate, but only a tiny bit compared to specifying them in the header of every file. From johan.tibell at gmail.com Mon Dec 1 15:11:48 2014 From: johan.tibell at gmail.com (Johan Tibell) Date: Mon, 1 Dec 2014 16:11:48 +0100 Subject: [Haskell-cafe] Haskell 2014 In-Reply-To: References: <137871417313010@web12h.yandex.ru> <547B03AD.2070101@ro-che.info> <491361417350555@web22g.yandex.ru> <547B30EC.6070405@ro-che.info> <54EA2BCB-7F32-42C6-9D09-14346EBAAAF5@gmail.com> <6320D9A1-6C76-4DD2-AC50-1401FF489A7A@cs.otago.ac.nz> <0BDA1054-9609-452C-92B4-923B6BAA841E@ouroborus.net> Message-ID: I would like BangPatterns to be in the standard for example. It's defacto standard now, as in "most core libraries don't compile without it". On Mon, Dec 1, 2014 at 3:50 PM, Patrick Chilton wrote: > Even if there's not much interest in a new standard, is there any hope for > turning on "benign" language extensions by default anytime soon? It seems > like unnecessary boilerplate. > > Patrick > > On Mon, Dec 1, 2014 at 2:25 PM, David Feuer wrote: > >> On Mon, Dec 1, 2014 at 12:01 AM, wrote: >> >>> What counts for the development and growth of a programming >>> language is the community behind it, and Haskell is blessed >>> with some really amazing people. >>> >> >> Most of those amazing people care more about keeping the language growing >> than about rigid adherence to a standard or complete backwards >> compatibility. >> >> >>> However, it remains true that some companies expect to >>> outlive their suppliers, and that the existence of a >>> standard gives them some confidence that avoiding things >>> outside it will reduce their risks. That's all. >>> >> >> Since all Haskell implementations of any significance, historical or >> otherwise, are open source, this is a red herring. If the GHC project dies, >> anyone relying on GHC is free to continue development themselves. >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kyle.marek.spartz at gmail.com Mon Dec 1 16:25:25 2014 From: kyle.marek.spartz at gmail.com (Kyle Marek-Spartz) Date: Mon, 01 Dec 2014 10:25:25 -0600 Subject: [Haskell-cafe] Getting Haskell in the top 20 In-Reply-To: References: <547B55DE.1010104@mcmaster.ca> Message-ID: <2fcp3soarn49sa.fsf@gmail.com> The point is that the TIOBE index doesn't track that stuff directly, but indirectly through mentions. If the items you mention result in more people talking about "Haskell programming" then it will result in a higher index score. Henk-Jan van Tuyl writes: > Using the words "Haskell" and "programming" in emails probably helps > getting Haskell a few places up, but I think there is much more needed to > get it in the top twenty. Things like a GHC backend that produces Java > bytecode and/or Common Intermediate Language, commercial support, or > Microsoft delivering Haskell in a Visual Studio environment. These are > things that will raise much more interest in Haskell in the commercial > world, and therefore would also interest more programmers. > > Regards, > Henk-Jan van Tuyl > > > On Sun, 30 Nov 2014 18:37:34 +0100, Jacques Carette > wrote: > >> Make sure the actual words "Haskell programming" occur in as many places >> as possible [posts here, on reddit, on stackoverflow, etc]. Not >> variants of those words, but those exact words. Like you did in your >> .sig (although that may not be indexed, so it may need to be in the >> actual text). >> >> Get it into people's phrasing that they always speak of "Haskell >> programming", not Haskell code, coding, etc, etc. >> >> Jacques >> >> On 2014-11-30 11:29 AM, Henk-Jan van Tuyl wrote: >>> >>> L.S., >>> >>> In the Tiobe Index[0], F# jumped from position 43 in June to 13 in July >>> and is since than in the >>> top twenty. What happened in July and how can we get Haskell in the top >>> 20? >>> >>> Regards, >>> Henk-Jan van Tuyl >>> >>> >>> [0] http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html > > -- > Folding at home > What if you could share your unused computer power to help find a cure? In > just 5 minutes you can join the world's biggest networked computer and get > us closer sooner. Watch the video. > http://folding.stanford.edu/ > > > http://Van.Tuyl.eu/ > http://members.chello.nl/hjgtuyl/tourdemonad.html > Haskell programming -- Kyle Marek-Spartz From sean at functionaljobs.com Mon Dec 1 17:00:01 2014 From: sean at functionaljobs.com (Functional Jobs) Date: Mon, 1 Dec 2014 12:00:01 -0500 Subject: [Haskell-cafe] New Functional Programming Job Opportunities Message-ID: <547c9e97e989a@functionaljobs.com> Here are some functional programming job opportunities that were posted recently: Scala Developer at Mediative http://functionaljobs.com/jobs/8767-scala-developer-at-mediative Cheers, Sean Murphy FunctionalJobs.com From ben at smart-cactus.org Mon Dec 1 17:05:08 2014 From: ben at smart-cactus.org (Ben Gamari) Date: Mon, 01 Dec 2014 12:05:08 -0500 Subject: [Haskell-cafe] Julia and Charts on Mac In-Reply-To: <73585950-B269-49FC-998E-188891402644@steinitz.org> References: <73585950-B269-49FC-998E-188891402644@steinitz.org> Message-ID: <87r3wjfghn.fsf@gmail.com> Dominic Steinitz writes: > I just had an interesting experience installing the Julia charts > package (Gadfly based on ggplot) on my Mac which I thought I would > share as I know I and other folk have had trouble getting diagrams / > Cairo to work on Macs. > I agree that the current cairo situation could be improved. The fact that gtk2hs can't properly depend upon gtk2hs-buildtools means that nearly anyone who needs to needs to install any Cairo-based package with Cabal has at very least one non-trivial hoop to jump through. In my experience this is often only the first of several. This has always perplexed me as Cairo isn't glib-based, unlike the other members of the gtk2hs family. Binding to Cairo should (as far as I know) be no harder than binding to any other pure C library. It seems like the situation could be improved substantially by simply splitting cairo out of gtk2hs, using standard FFI code generation tools (bindings-dsl works pretty well in my experience, although plain hsc2hs is also acceptable), and simplifying its build system. That being said, part of me thinks that the days of Cairo being dominant means of drawing are numbered. Diagrams can produce SVG without any help From Cairo and Chart can now use diagrams as its backend. I would hope that installation of pure Haskell libraries would be no harder than Julia's process. The only reason I can think of why this wouldn't be the case is Cabal hell. While Julia may not suffer from package-hell yet (due to the young age and batteries-included nature of the distribution) they will inevitably need to deal with it at some point. > It installs homebrew and then all the required packages from its own > repo (not sure what the homebrew terminology is for this - possibly a > brewery?) so presumably guaranteeing that the installation is > consistent and ?just works?. I must say I was a bit surprised (I think > I would have liked it to tell me what it was about to do) but it was > entirely painless and I drew my first chart after less than 5 minutes. > Sounds like quite a pleasant process. It's a shame there isn't more community interest in maintaining a Haskell homebrew repository. It seems like this could substantially improve the OS X support story. > PS I am not sure that haskell-cafe is the right list to share this on > but as we don?t have a mailing list for numerical stuff or mac > stuff... I appreciated the post. Cheers, - Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 472 bytes Desc: not available URL: From carter.schonwald at gmail.com Mon Dec 1 17:32:51 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 1 Dec 2014 12:32:51 -0500 Subject: [Haskell-cafe] Julia and Charts on Mac In-Reply-To: <87r3wjfghn.fsf@gmail.com> References: <73585950-B269-49FC-998E-188891402644@steinitz.org> <87r3wjfghn.fsf@gmail.com> Message-ID: on the OS X ease of install front, ghcformacosx.github.io is a bit easier to do that homebrew (or at least in my opinionated opinion), and has much better zeroconfig / isolation On Mon, Dec 1, 2014 at 12:05 PM, Ben Gamari wrote: > Dominic Steinitz writes: > > > I just had an interesting experience installing the Julia charts > > package (Gadfly based on ggplot) on my Mac which I thought I would > > share as I know I and other folk have had trouble getting diagrams / > > Cairo to work on Macs. > > > I agree that the current cairo situation could be improved. The fact that > gtk2hs can't properly depend upon gtk2hs-buildtools means that nearly > anyone who needs to needs to install any Cairo-based package with > Cabal has at very least one non-trivial hoop to jump through. In my > experience this is often only the first of several. > > This has always perplexed me as Cairo isn't glib-based, unlike the other > members of the gtk2hs family. Binding to Cairo should (as far as I know) > be no harder than binding to any other pure C library. It seems like the > situation could be improved substantially by simply splitting cairo out > of gtk2hs, using standard FFI code generation tools (bindings-dsl works > pretty well in my experience, although plain hsc2hs is also acceptable), > and simplifying its build system. > > That being said, part of me thinks that the days of Cairo being dominant > means of drawing are numbered. Diagrams can produce SVG without any help > From Cairo and Chart can now use diagrams as its backend. I would hope > that installation of pure Haskell libraries would be no harder than > Julia's process. > > The only reason I can think of why this wouldn't be the case is Cabal > hell. While Julia may not suffer from package-hell yet (due to the young > age and batteries-included nature of the distribution) they will > inevitably need to deal with it at some point. > > > It installs homebrew and then all the required packages from its own > > repo (not sure what the homebrew terminology is for this - possibly a > > brewery?) so presumably guaranteeing that the installation is > > consistent and ?just works?. I must say I was a bit surprised (I think > > I would have liked it to tell me what it was about to do) but it was > > entirely painless and I drew my first chart after less than 5 minutes. > > > Sounds like quite a pleasant process. It's a shame there isn't more > community interest in maintaining a Haskell homebrew repository. It > seems like this could substantially improve the OS X support story. > > > PS I am not sure that haskell-cafe is the right list to share this on > > but as we don?t have a mailing list for numerical stuff or mac > > stuff... > > I appreciated the post. > > Cheers, > > - Ben > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidleothomas at gmail.com Mon Dec 1 20:53:05 2014 From: davidleothomas at gmail.com (David Thomas) Date: Mon, 1 Dec 2014 12:53:05 -0800 Subject: [Haskell-cafe] Getting Haskell in the top 20 In-Reply-To: <2fcp3soarn49sa.fsf@gmail.com> References: <547B55DE.1010104@mcmaster.ca> <2fcp3soarn49sa.fsf@gmail.com> Message-ID: As opposed to "Haskell golf shoes". On Mon, Dec 1, 2014 at 8:25 AM, Kyle Marek-Spartz wrote: > The point is that the TIOBE index doesn't track that stuff directly, but > indirectly through mentions. If the items you mention result in more > people talking about "Haskell programming" then it will result in a > higher index score. > > > Henk-Jan van Tuyl writes: > >> Using the words "Haskell" and "programming" in emails probably helps >> getting Haskell a few places up, but I think there is much more needed to >> get it in the top twenty. Things like a GHC backend that produces Java >> bytecode and/or Common Intermediate Language, commercial support, or >> Microsoft delivering Haskell in a Visual Studio environment. These are >> things that will raise much more interest in Haskell in the commercial >> world, and therefore would also interest more programmers. >> >> Regards, >> Henk-Jan van Tuyl >> >> >> On Sun, 30 Nov 2014 18:37:34 +0100, Jacques Carette >> wrote: >> >>> Make sure the actual words "Haskell programming" occur in as many places >>> as possible [posts here, on reddit, on stackoverflow, etc]. Not >>> variants of those words, but those exact words. Like you did in your >>> .sig (although that may not be indexed, so it may need to be in the >>> actual text). >>> >>> Get it into people's phrasing that they always speak of "Haskell >>> programming", not Haskell code, coding, etc, etc. >>> >>> Jacques >>> >>> On 2014-11-30 11:29 AM, Henk-Jan van Tuyl wrote: >>>> >>>> L.S., >>>> >>>> In the Tiobe Index[0], F# jumped from position 43 in June to 13 in July >>>> and is since than in the >>>> top twenty. What happened in July and how can we get Haskell in the top >>>> 20? >>>> >>>> Regards, >>>> Henk-Jan van Tuyl >>>> >>>> >>>> [0] http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html >> >> -- >> Folding at home >> What if you could share your unused computer power to help find a cure? In >> just 5 minutes you can join the world's biggest networked computer and get >> us closer sooner. Watch the video. >> http://folding.stanford.edu/ >> >> >> http://Van.Tuyl.eu/ >> http://members.chello.nl/hjgtuyl/tourdemonad.html >> Haskell programming > > -- > Kyle Marek-Spartz > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From ahammel87 at gmail.com Mon Dec 1 21:08:54 2014 From: ahammel87 at gmail.com (Alex Hammel) Date: Mon, 1 Dec 2014 13:08:54 -0800 Subject: [Haskell-cafe] Getting Haskell in the top 20 In-Reply-To: References: <547B55DE.1010104@mcmaster.ca> <2fcp3soarn49sa.fsf@gmail.com> Message-ID: Or the Haskell architecture firm, or the Haskell Indian Nations University, or Eddie Haskell the character from Leave it to Beaver, etc. etc. On Mon, Dec 1, 2014 at 12:53 PM, David Thomas wrote: > As opposed to "Haskell golf shoes". > > On Mon, Dec 1, 2014 at 8:25 AM, Kyle Marek-Spartz > wrote: > > The point is that the TIOBE index doesn't track that stuff directly, but > > indirectly through mentions. If the items you mention result in more > > people talking about "Haskell programming" then it will result in a > > higher index score. > > > > > > Henk-Jan van Tuyl writes: > > > >> Using the words "Haskell" and "programming" in emails probably helps > >> getting Haskell a few places up, but I think there is much more needed > to > >> get it in the top twenty. Things like a GHC backend that produces Java > >> bytecode and/or Common Intermediate Language, commercial support, or > >> Microsoft delivering Haskell in a Visual Studio environment. These are > >> things that will raise much more interest in Haskell in the commercial > >> world, and therefore would also interest more programmers. > >> > >> Regards, > >> Henk-Jan van Tuyl > >> > >> > >> On Sun, 30 Nov 2014 18:37:34 +0100, Jacques Carette < > carette at mcmaster.ca> > >> wrote: > >> > >>> Make sure the actual words "Haskell programming" occur in as many > places > >>> as possible [posts here, on reddit, on stackoverflow, etc]. Not > >>> variants of those words, but those exact words. Like you did in your > >>> .sig (although that may not be indexed, so it may need to be in the > >>> actual text). > >>> > >>> Get it into people's phrasing that they always speak of "Haskell > >>> programming", not Haskell code, coding, etc, etc. > >>> > >>> Jacques > >>> > >>> On 2014-11-30 11:29 AM, Henk-Jan van Tuyl wrote: > >>>> > >>>> L.S., > >>>> > >>>> In the Tiobe Index[0], F# jumped from position 43 in June to 13 in > July > >>>> and is since than in the > >>>> top twenty. What happened in July and how can we get Haskell in the > top > >>>> 20? > >>>> > >>>> Regards, > >>>> Henk-Jan van Tuyl > >>>> > >>>> > >>>> [0] http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html > >> > >> -- > >> Folding at home > >> What if you could share your unused computer power to help find a cure? > In > >> just 5 minutes you can join the world's biggest networked computer and > get > >> us closer sooner. Watch the video. > >> http://folding.stanford.edu/ > >> > >> > >> http://Van.Tuyl.eu/ > >> http://members.chello.nl/hjgtuyl/tourdemonad.html > >> Haskell programming > > > > -- > > Kyle Marek-Spartz > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From agocorona at gmail.com Mon Dec 1 21:42:53 2014 From: agocorona at gmail.com (Alberto G. Corona ) Date: Mon, 1 Dec 2014 22:42:53 +0100 Subject: [Haskell-cafe] Getting Haskell in the top 20 In-Reply-To: References: <547B55DE.1010104@mcmaster.ca> <2fcp3soarn49sa.fsf@gmail.com> Message-ID: My contribution for today: haskell programming, haskell programming, haskell programming. 2014-12-01 22:08 GMT+01:00 Alex Hammel : > Or the Haskell architecture firm, or the Haskell Indian Nations > University, or Eddie Haskell the character from Leave it to Beaver, etc. > etc. > > On Mon, Dec 1, 2014 at 12:53 PM, David Thomas > wrote: > >> As opposed to "Haskell golf shoes". >> >> On Mon, Dec 1, 2014 at 8:25 AM, Kyle Marek-Spartz >> wrote: >> > The point is that the TIOBE index doesn't track that stuff directly, but >> > indirectly through mentions. If the items you mention result in more >> > people talking about "Haskell programming" then it will result in a >> > higher index score. >> > >> > >> > Henk-Jan van Tuyl writes: >> > >> >> Using the words "Haskell" and "programming" in emails probably helps >> >> getting Haskell a few places up, but I think there is much more needed >> to >> >> get it in the top twenty. Things like a GHC backend that produces Java >> >> bytecode and/or Common Intermediate Language, commercial support, or >> >> Microsoft delivering Haskell in a Visual Studio environment. These are >> >> things that will raise much more interest in Haskell in the commercial >> >> world, and therefore would also interest more programmers. >> >> >> >> Regards, >> >> Henk-Jan van Tuyl >> >> >> >> >> >> On Sun, 30 Nov 2014 18:37:34 +0100, Jacques Carette < >> carette at mcmaster.ca> >> >> wrote: >> >> >> >>> Make sure the actual words "Haskell programming" occur in as many >> places >> >>> as possible [posts here, on reddit, on stackoverflow, etc]. Not >> >>> variants of those words, but those exact words. Like you did in your >> >>> .sig (although that may not be indexed, so it may need to be in the >> >>> actual text). >> >>> >> >>> Get it into people's phrasing that they always speak of "Haskell >> >>> programming", not Haskell code, coding, etc, etc. >> >>> >> >>> Jacques >> >>> >> >>> On 2014-11-30 11:29 AM, Henk-Jan van Tuyl wrote: >> >>>> >> >>>> L.S., >> >>>> >> >>>> In the Tiobe Index[0], F# jumped from position 43 in June to 13 in >> July >> >>>> and is since than in the >> >>>> top twenty. What happened in July and how can we get Haskell in the >> top >> >>>> 20? >> >>>> >> >>>> Regards, >> >>>> Henk-Jan van Tuyl >> >>>> >> >>>> >> >>>> [0] http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html >> >> >> >> -- >> >> Folding at home >> >> What if you could share your unused computer power to help find a >> cure? In >> >> just 5 minutes you can join the world's biggest networked computer and >> get >> >> us closer sooner. Watch the video. >> >> http://folding.stanford.edu/ >> >> >> >> >> >> http://Van.Tuyl.eu/ >> >> http://members.chello.nl/hjgtuyl/tourdemonad.html >> >> Haskell programming >> > >> > -- >> > Kyle Marek-Spartz >> > _______________________________________________ >> > Haskell-Cafe mailing list >> > Haskell-Cafe at haskell.org >> > http://www.haskell.org/mailman/listinfo/haskell-cafe >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Alberto. -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.l2ll at gmail.com Mon Dec 1 21:49:12 2014 From: markus.l2ll at gmail.com (=?UTF-8?B?TWFya3VzIEzDpGxs?=) Date: Mon, 1 Dec 2014 23:49:12 +0200 Subject: [Haskell-cafe] Getting Haskell in the top 20 In-Reply-To: References: <547B55DE.1010104@mcmaster.ca> <2fcp3soarn49sa.fsf@gmail.com> Message-ID: I thought we were trying to avoid success? On Mon, Dec 1, 2014 at 11:42 PM, Alberto G. Corona wrote: > My contribution for today: > > haskell programming, haskell programming, haskell programming. > > > 2014-12-01 22:08 GMT+01:00 Alex Hammel : > >> Or the Haskell architecture firm, or the Haskell Indian Nations >> University, or Eddie Haskell the character from Leave it to Beaver, etc. >> etc. >> >> On Mon, Dec 1, 2014 at 12:53 PM, David Thomas >> wrote: >> >>> As opposed to "Haskell golf shoes". >>> >>> On Mon, Dec 1, 2014 at 8:25 AM, Kyle Marek-Spartz >>> wrote: >>> > The point is that the TIOBE index doesn't track that stuff directly, >>> but >>> > indirectly through mentions. If the items you mention result in more >>> > people talking about "Haskell programming" then it will result in a >>> > higher index score. >>> > >>> > >>> > Henk-Jan van Tuyl writes: >>> > >>> >> Using the words "Haskell" and "programming" in emails probably helps >>> >> getting Haskell a few places up, but I think there is much more >>> needed to >>> >> get it in the top twenty. Things like a GHC backend that produces Java >>> >> bytecode and/or Common Intermediate Language, commercial support, or >>> >> Microsoft delivering Haskell in a Visual Studio environment. These are >>> >> things that will raise much more interest in Haskell in the commercial >>> >> world, and therefore would also interest more programmers. >>> >> >>> >> Regards, >>> >> Henk-Jan van Tuyl >>> >> >>> >> >>> >> On Sun, 30 Nov 2014 18:37:34 +0100, Jacques Carette < >>> carette at mcmaster.ca> >>> >> wrote: >>> >> >>> >>> Make sure the actual words "Haskell programming" occur in as many >>> places >>> >>> as possible [posts here, on reddit, on stackoverflow, etc]. Not >>> >>> variants of those words, but those exact words. Like you did in your >>> >>> .sig (although that may not be indexed, so it may need to be in the >>> >>> actual text). >>> >>> >>> >>> Get it into people's phrasing that they always speak of "Haskell >>> >>> programming", not Haskell code, coding, etc, etc. >>> >>> >>> >>> Jacques >>> >>> >>> >>> On 2014-11-30 11:29 AM, Henk-Jan van Tuyl wrote: >>> >>>> >>> >>>> L.S., >>> >>>> >>> >>>> In the Tiobe Index[0], F# jumped from position 43 in June to 13 in >>> July >>> >>>> and is since than in the >>> >>>> top twenty. What happened in July and how can we get Haskell in the >>> top >>> >>>> 20? >>> >>>> >>> >>>> Regards, >>> >>>> Henk-Jan van Tuyl >>> >>>> >>> >>>> >>> >>>> [0] >>> http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html >>> >> >>> >> -- >>> >> Folding at home >>> >> What if you could share your unused computer power to help find a >>> cure? In >>> >> just 5 minutes you can join the world's biggest networked computer >>> and get >>> >> us closer sooner. Watch the video. >>> >> http://folding.stanford.edu/ >>> >> >>> >> >>> >> http://Van.Tuyl.eu/ >>> >> http://members.chello.nl/hjgtuyl/tourdemonad.html >>> >> Haskell programming >>> > >>> > -- >>> > Kyle Marek-Spartz >>> > _______________________________________________ >>> > Haskell-Cafe mailing list >>> > Haskell-Cafe at haskell.org >>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > Alberto. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Markus L?ll -------------- next part -------------- An HTML attachment was scrubbed... URL: From mwm at mired.org Mon Dec 1 21:50:56 2014 From: mwm at mired.org (Mike Meyer) Date: Mon, 1 Dec 2014 15:50:56 -0600 Subject: [Haskell-cafe] Getting Haskell in the top 20 In-Reply-To: References: <547B55DE.1010104@mcmaster.ca> <2fcp3soarn49sa.fsf@gmail.com> Message-ID: Basically, what you want to do is similar to "link bombing". From experience, one person can - or maybe could - do a pretty good job of this. Put it in your signature line and post to discussion groups that get archived in multiple places on the web - anything that was gatewayed to netnews worked great for this, but that may now be dead. And Google at least has tweaked their algorithms to prevent this. On Mon, Dec 1, 2014 at 3:42 PM, Alberto G. Corona wrote: > My contribution for today: > > haskell programming, haskell programming, haskell programming. > > > 2014-12-01 22:08 GMT+01:00 Alex Hammel : > >> Or the Haskell architecture firm, or the Haskell Indian Nations >> University, or Eddie Haskell the character from Leave it to Beaver, etc. >> etc. >> >> On Mon, Dec 1, 2014 at 12:53 PM, David Thomas >> wrote: >> >>> As opposed to "Haskell golf shoes". >>> >>> On Mon, Dec 1, 2014 at 8:25 AM, Kyle Marek-Spartz >>> wrote: >>> > The point is that the TIOBE index doesn't track that stuff directly, >>> but >>> > indirectly through mentions. If the items you mention result in more >>> > people talking about "Haskell programming" then it will result in a >>> > higher index score. >>> > >>> > >>> > Henk-Jan van Tuyl writes: >>> > >>> >> Using the words "Haskell" and "programming" in emails probably helps >>> >> getting Haskell a few places up, but I think there is much more >>> needed to >>> >> get it in the top twenty. Things like a GHC backend that produces Java >>> >> bytecode and/or Common Intermediate Language, commercial support, or >>> >> Microsoft delivering Haskell in a Visual Studio environment. These are >>> >> things that will raise much more interest in Haskell in the commercial >>> >> world, and therefore would also interest more programmers. >>> >> >>> >> Regards, >>> >> Henk-Jan van Tuyl >>> >> >>> >> >>> >> On Sun, 30 Nov 2014 18:37:34 +0100, Jacques Carette < >>> carette at mcmaster.ca> >>> >> wrote: >>> >> >>> >>> Make sure the actual words "Haskell programming" occur in as many >>> places >>> >>> as possible [posts here, on reddit, on stackoverflow, etc]. Not >>> >>> variants of those words, but those exact words. Like you did in your >>> >>> .sig (although that may not be indexed, so it may need to be in the >>> >>> actual text). >>> >>> >>> >>> Get it into people's phrasing that they always speak of "Haskell >>> >>> programming", not Haskell code, coding, etc, etc. >>> >>> >>> >>> Jacques >>> >>> >>> >>> On 2014-11-30 11:29 AM, Henk-Jan van Tuyl wrote: >>> >>>> >>> >>>> L.S., >>> >>>> >>> >>>> In the Tiobe Index[0], F# jumped from position 43 in June to 13 in >>> July >>> >>>> and is since than in the >>> >>>> top twenty. What happened in July and how can we get Haskell in the >>> top >>> >>>> 20? >>> >>>> >>> >>>> Regards, >>> >>>> Henk-Jan van Tuyl >>> >>>> >>> >>>> >>> >>>> [0] >>> http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html >>> >> >>> >> -- >>> >> Folding at home >>> >> What if you could share your unused computer power to help find a >>> cure? In >>> >> just 5 minutes you can join the world's biggest networked computer >>> and get >>> >> us closer sooner. Watch the video. >>> >> http://folding.stanford.edu/ >>> >> >>> >> >>> >> http://Van.Tuyl.eu/ >>> >> http://members.chello.nl/hjgtuyl/tourdemonad.html >>> >> Haskell programming >>> > >>> > -- >>> > Kyle Marek-Spartz >>> > _______________________________________________ >>> > Haskell-Cafe mailing list >>> > Haskell-Cafe at haskell.org >>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > Alberto. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jake.mcarthur at gmail.com Mon Dec 1 23:37:55 2014 From: jake.mcarthur at gmail.com (Jake McArthur) Date: Mon, 1 Dec 2014 18:37:55 -0500 Subject: [Haskell-cafe] Getting Haskell in the top 20 In-Reply-To: References: <547B55DE.1010104@mcmaster.ca> <2fcp3soarn49sa.fsf@gmail.com> Message-ID: It's "avoid 'success at all costs,'" not "avoid success, at all costs." (Sorry for the double email, Markus, but I meant to reply-all the first time.) On Dec 1, 2014 4:49 PM, "Markus L?ll" wrote: > I thought we were trying to avoid success? > > On Mon, Dec 1, 2014 at 11:42 PM, Alberto G. Corona > wrote: > >> My contribution for today: >> >> haskell programming, haskell programming, haskell programming. >> >> >> 2014-12-01 22:08 GMT+01:00 Alex Hammel : >> >>> Or the Haskell architecture firm, or the Haskell Indian Nations >>> University, or Eddie Haskell the character from Leave it to Beaver, etc. >>> etc. >>> >>> On Mon, Dec 1, 2014 at 12:53 PM, David Thomas >>> wrote: >>> >>>> As opposed to "Haskell golf shoes". >>>> >>>> On Mon, Dec 1, 2014 at 8:25 AM, Kyle Marek-Spartz >>>> wrote: >>>> > The point is that the TIOBE index doesn't track that stuff directly, >>>> but >>>> > indirectly through mentions. If the items you mention result in more >>>> > people talking about "Haskell programming" then it will result in a >>>> > higher index score. >>>> > >>>> > >>>> > Henk-Jan van Tuyl writes: >>>> > >>>> >> Using the words "Haskell" and "programming" in emails probably helps >>>> >> getting Haskell a few places up, but I think there is much more >>>> needed to >>>> >> get it in the top twenty. Things like a GHC backend that produces >>>> Java >>>> >> bytecode and/or Common Intermediate Language, commercial support, or >>>> >> Microsoft delivering Haskell in a Visual Studio environment. These >>>> are >>>> >> things that will raise much more interest in Haskell in the >>>> commercial >>>> >> world, and therefore would also interest more programmers. >>>> >> >>>> >> Regards, >>>> >> Henk-Jan van Tuyl >>>> >> >>>> >> >>>> >> On Sun, 30 Nov 2014 18:37:34 +0100, Jacques Carette < >>>> carette at mcmaster.ca> >>>> >> wrote: >>>> >> >>>> >>> Make sure the actual words "Haskell programming" occur in as many >>>> places >>>> >>> as possible [posts here, on reddit, on stackoverflow, etc]. Not >>>> >>> variants of those words, but those exact words. Like you did in >>>> your >>>> >>> .sig (although that may not be indexed, so it may need to be in the >>>> >>> actual text). >>>> >>> >>>> >>> Get it into people's phrasing that they always speak of "Haskell >>>> >>> programming", not Haskell code, coding, etc, etc. >>>> >>> >>>> >>> Jacques >>>> >>> >>>> >>> On 2014-11-30 11:29 AM, Henk-Jan van Tuyl wrote: >>>> >>>> >>>> >>>> L.S., >>>> >>>> >>>> >>>> In the Tiobe Index[0], F# jumped from position 43 in June to 13 in >>>> July >>>> >>>> and is since than in the >>>> >>>> top twenty. What happened in July and how can we get Haskell in >>>> the top >>>> >>>> 20? >>>> >>>> >>>> >>>> Regards, >>>> >>>> Henk-Jan van Tuyl >>>> >>>> >>>> >>>> >>>> >>>> [0] >>>> http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html >>>> >> >>>> >> -- >>>> >> Folding at home >>>> >> What if you could share your unused computer power to help find a >>>> cure? In >>>> >> just 5 minutes you can join the world's biggest networked computer >>>> and get >>>> >> us closer sooner. Watch the video. >>>> >> http://folding.stanford.edu/ >>>> >> >>>> >> >>>> >> http://Van.Tuyl.eu/ >>>> >> http://members.chello.nl/hjgtuyl/tourdemonad.html >>>> >> Haskell programming >>>> > >>>> > -- >>>> > Kyle Marek-Spartz >>>> > _______________________________________________ >>>> > Haskell-Cafe mailing list >>>> > Haskell-Cafe at haskell.org >>>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> >> -- >> Alberto. >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > Markus L?ll > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From trebla at vex.net Mon Dec 1 23:54:33 2014 From: trebla at vex.net (Albert Y. C. Lai) Date: Mon, 01 Dec 2014 18:54:33 -0500 Subject: [Haskell-cafe] Using ghc-mod with FFI In-Reply-To: References: Message-ID: <547CFFB9.4060105@vex.net> On 2014-11-28 05:11 PM, Dan Piponi wrote: > In my code I have this line: > > foreign import ccall "set_num_states" setNumStates :: Int -> IO () > > I can build my project using cabal and have an appropriate > "c-sources:" line. > > But when I use ghc-mod check (eg. from " ghc-mod-5.2.0.0", and > launched from Syntastic) it complains: > > "ghc-mod: > ByteCodeLink: can't find label > During interactive linking, GHCi couldn't find the following symbol: > set_num_states" > > How should I be checking my code? I don't know about ghc-mod. But I know ghci, and you may be able to lift ghci things to ghc-mod things. "ghci M.hs" or "ghci" and then ":load M.hs" gives the same error. However, you're expected to: (if your C file is s.c) "ghci s.o M.hs" or "ghci M.hs s.o" or "ghci s.o" and then ":load M.hs" that's how ghci knows where to find set_num_states. See also GHC user's guide section 2.6.2. From marco.vax91 at gmail.com Tue Dec 2 01:28:48 2014 From: marco.vax91 at gmail.com (Marco Vassena) Date: Tue, 2 Dec 2014 02:28:48 +0100 Subject: [Haskell-cafe] Use distributivity proof in a simple example Message-ID: <0393AFB2-7F94-4D97-A651-47C6C18C04DF@gmail.com> My GADT data type is indexed over type level list. data DF (xs :: [ * ]) where Empty :: DF [] Single :: a -> DF '[ a ] Cons :: DF xs -> DF ys -> DF (Append xs ys) Append is a type family that append two type level lists: type family Append (xs :: [ * ]) (ys :: [ * ]) :: [ * ] where Append '[] ys = ys Append (x ': xs) ys = x ': Append xs ys Map is a type level map: type family Map (f :: * -> *) (xs :: [ * ]) :: [ * ] where Map f '[] = '[] Map f (x ': xs) = f x ': Map f xs Now I want to write a function that wraps all the component in Single in a list: wrap :: DF xs -> DF (Map [] xs) wrap Empty = Empty wrap (Single a) = Single [ a ] wrap (Cons x y) = Cons (wrap x) (wrap y) -- Type Error The type-checker doesn't know anything about distributivity: Could not deduce (Append (Map [] xs) (Map [] ys) ~ Map [] zs) from the context (zs ~ Append xs ys) I managed to prove this property by induction on the first type level list. class MapDist xs where mapDist :: (zs ~ Append xs ys) => Proxy xs -> Proxy ys -> Append (Map [] xs) (Map [] ys) :~: Map [] zs instance MapDist '[] where mapDist Proxy Proxy = Refl tailP :: Proxy (x ': xs) -> Proxy xs tailP _ = Proxy instance MapDist xs => MapDist (x ': xs) where mapDist p1 p2 = case mapDist (tailP p1) p2 of Refl -> Refl I have adjusted wrap as follows: toProxy :: DataFormat xs -> Proxy xs toProxy _ = Proxy wrap (Cons x y) = let p1 = toProxy x p2 = toProxy y in case mapDist p1 p2 of Refl -> Cons (wrap x) (wrap y) The problem now is that MapDist xs is not in the context. Adding it to the Cons constructor in the GADT definition does not solve the problem: Could not deduce (MapDist (Map [] xs)) ... How can I solve this issue? Clearly the two instances of MapDist cover all possible cases, and therefore it should be possible to use it for any list xs. I tried avoiding the type class MapDist with a normal function: proof :: forall xs ys zs . Append xs ys ~ zs => Proxy xs -> Proxy ys -> Proxy zs -> Append (Map [] xs) (Map [] ys) :~: Map [] zs However here I have no mean to distinguish the base case ('[]) from the inductive case (x ': xs), thus I cannot complete the proof. Do you have any idea, suggestion or workaround for this kind of situations? Cheers, Marco From kyle.marek.spartz at gmail.com Tue Dec 2 04:09:29 2014 From: kyle.marek.spartz at gmail.com (Kyle Marek-Spartz) Date: Mon, 01 Dec 2014 22:09:29 -0600 Subject: [Haskell-cafe] Julia and Charts on Mac In-Reply-To: References: <73585950-B269-49FC-998E-188891402644@steinitz.org> <87r3wjfghn.fsf@gmail.com> Message-ID: <2fcp3sa9364rra.fsf@gmail.com> If you use Homebrew Cask (http://caskroom.io/), you can: brew cask install ghc which uses the ghcformacosx.github.io installer. There's also installers in Cask for e.g. Leksah and some other useful Haskell tools. Carter Schonwald writes: > on the OS X ease of install front, ghcformacosx.github.io is a bit easier > to do that homebrew (or at least in my opinionated opinion), and has much > better zeroconfig / isolation > > On Mon, Dec 1, 2014 at 12:05 PM, Ben Gamari wrote: > >> Dominic Steinitz writes: >> >> > I just had an interesting experience installing the Julia charts >> > package (Gadfly based on ggplot) on my Mac which I thought I would >> > share as I know I and other folk have had trouble getting diagrams / >> > Cairo to work on Macs. >> > >> I agree that the current cairo situation could be improved. The fact that >> gtk2hs can't properly depend upon gtk2hs-buildtools means that nearly >> anyone who needs to needs to install any Cairo-based package with >> Cabal has at very least one non-trivial hoop to jump through. In my >> experience this is often only the first of several. >> >> This has always perplexed me as Cairo isn't glib-based, unlike the other >> members of the gtk2hs family. Binding to Cairo should (as far as I know) >> be no harder than binding to any other pure C library. It seems like the >> situation could be improved substantially by simply splitting cairo out >> of gtk2hs, using standard FFI code generation tools (bindings-dsl works >> pretty well in my experience, although plain hsc2hs is also acceptable), >> and simplifying its build system. >> >> That being said, part of me thinks that the days of Cairo being dominant >> means of drawing are numbered. Diagrams can produce SVG without any help >> From Cairo and Chart can now use diagrams as its backend. I would hope >> that installation of pure Haskell libraries would be no harder than >> Julia's process. >> >> The only reason I can think of why this wouldn't be the case is Cabal >> hell. While Julia may not suffer from package-hell yet (due to the young >> age and batteries-included nature of the distribution) they will >> inevitably need to deal with it at some point. >> >> > It installs homebrew and then all the required packages from its own >> > repo (not sure what the homebrew terminology is for this - possibly a >> > brewery?) so presumably guaranteeing that the installation is >> > consistent and ?just works?. I must say I was a bit surprised (I think >> > I would have liked it to tell me what it was about to do) but it was >> > entirely painless and I drew my first chart after less than 5 minutes. >> > >> Sounds like quite a pleasant process. It's a shame there isn't more >> community interest in maintaining a Haskell homebrew repository. It >> seems like this could substantially improve the OS X support story. >> >> > PS I am not sure that haskell-cafe is the right list to share this on >> > but as we don?t have a mailing list for numerical stuff or mac >> > stuff... >> >> I appreciated the post. >> >> Cheers, >> >> - Ben >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Kyle Marek-Spartz From adam at well-typed.com Tue Dec 2 08:27:08 2014 From: adam at well-typed.com (Adam Gundry) Date: Tue, 02 Dec 2014 08:27:08 +0000 Subject: [Haskell-cafe] Use distributivity proof in a simple example In-Reply-To: <0393AFB2-7F94-4D97-A651-47C6C18C04DF@gmail.com> References: <0393AFB2-7F94-4D97-A651-47C6C18C04DF@gmail.com> Message-ID: <547D77DC.5090607@well-typed.com> Hi Marco, I think typeclasses are a bit of a red herring here: the problem, as you observed, is that it isn't possible to write a useful term of type proof :: forall xs ys zs . Append xs ys ~ zs => Proxy xs -> Proxy ys -> Proxy zs -> Append (Map [] xs) (Map [] ys) :~: Map [] zs because the runtime behaviour of proof (i.e. the program that constructs the witness to the equality) must depend on xs. (With typeclasses, the unsolved constraint of type `MapDist xs` amounts to needing this argument to be passed at runtime; having the two cases covered by class instances isn't enough.) The nice way to solve this problem would be to use a dependent product (pi-type), which would allow a single argument to be used both in types (like forall) and at runtime (like normal functions). Unfortunately, Haskell doesn't support pi-types (yet...) but we can fake them with a standard trick known as "singleton types", like this: -- The singleton type of lists, which allows us to take a list as a -- term-level and a type-level argument at the same time (although -- we're not interested in the elements here, only the structure) data SList xs where SNil :: SList '[] SCons :: SList xs -> SList (x ': xs) -- Now mapDist takes xs at runtime but ys/zs only at compile time mapDist :: zs ~ Append xs ys => SList xs -> proxy ys -> Append (Map [] xs) (Map [] ys) :~: Map [] zs mapDist SNil _ = Refl mapDist (SCons l) p = apply Refl (mapDist l p) -- Connect term-level and type-level list append append :: SList xs -> SList ys -> SList (Append xs ys) append SNil ys = ys append (SCons xs) ys = SCons (append xs ys) -- Convert your DF type into a list toSingleton :: DF xs -> SList xs toSingleton Empty = SNil toSingleton (Single _) = SCons SNil toSingleton (Cons xs ys) = append (toSingleton xs) (toSingleton ys) -- Now it's easy to define wrap wrap :: DF xs -> DF (Map [] xs) wrap Empty = Empty wrap (Single a) = Single [ a ] wrap (Cons x y) = case mapDist (toSingleton x) y of Refl -> Cons (wrap x) (wrap y) If you're interested in this technique, Richard and Jan's excellent "singletons" library [1] and accompanying paper take it much further. Hope this helps, Adam [1] http://hackage.haskell.org/package/singletons On 02/12/14 01:28, Marco Vassena wrote: > My GADT data type is indexed over type level list. > > data DF (xs :: [ * ]) where > Empty :: DF [] > Single :: a -> DF '[ a ] > Cons :: DF xs -> DF ys -> DF (Append xs ys) > > Append is a type family that append two type level lists: > type family Append (xs :: [ * ]) (ys :: [ * ]) :: [ * ] where > Append '[] ys = ys > Append (x ': xs) ys = x ': Append xs ys > > Map is a type level map: > type family Map (f :: * -> *) (xs :: [ * ]) :: [ * ] where > Map f '[] = '[] > Map f (x ': xs) = f x ': Map f xs > > Now I want to write a function that wraps all the component in Single in a list: > wrap :: DF xs -> DF (Map [] xs) > wrap Empty = Empty > wrap (Single a) = Single [ a ] > wrap (Cons x y) = Cons (wrap x) (wrap y) -- Type Error > > The type-checker doesn't know anything about distributivity: > Could not deduce (Append (Map [] xs) (Map [] ys) ~ Map [] zs) > from the context (zs ~ Append xs ys) > > I managed to prove this property by induction on the first type level list. > > class MapDist xs where > mapDist :: (zs ~ Append xs ys) => Proxy xs -> Proxy ys -> Append (Map [] xs) (Map [] ys) :~: Map [] zs > > instance MapDist '[] where > mapDist Proxy Proxy = Refl > > tailP :: Proxy (x ': xs) -> Proxy xs > tailP _ = Proxy > > instance MapDist xs => MapDist (x ': xs) where > mapDist p1 p2 = > case mapDist (tailP p1) p2 of > Refl -> Refl > > I have adjusted wrap as follows: > > toProxy :: DataFormat xs -> Proxy xs > toProxy _ = Proxy > > wrap (Cons x y) = > let p1 = toProxy x > p2 = toProxy y in > case mapDist p1 p2 of > Refl -> Cons (wrap x) (wrap y) > > The problem now is that MapDist xs is not in the context. > Adding it to the Cons constructor in the GADT definition does not solve the problem: > Could not deduce (MapDist (Map [] xs)) ... > > How can I solve this issue? > Clearly the two instances of MapDist cover all possible cases, and therefore it should be possible > to use it for any list xs. > > I tried avoiding the type class MapDist with a normal function: > proof :: forall xs ys zs . Append xs ys ~ zs => > Proxy xs -> Proxy ys -> Proxy zs -> > Append (Map [] xs) (Map [] ys) :~: Map [] zs > > However here I have no mean to distinguish the base case ('[]) from > the inductive case (x ': xs), thus I cannot complete the proof. > > Do you have any idea, suggestion or workaround for this kind of situations? > > Cheers, > Marco -- Adam Gundry, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/ From Graham.Hutton at nottingham.ac.uk Tue Dec 2 09:20:22 2014 From: Graham.Hutton at nottingham.ac.uk (Graham Hutton) Date: Tue, 2 Dec 2014 09:20:22 +0000 Subject: [Haskell-cafe] 10 PhD studentships in Nottingham Message-ID: <8B1B0A2A-1AB7-4762-B393-E99ED4A800C5@exmail.nottingham.ac.uk> Dear all, The School of Computer Science in Nottingham is advertising 10 fully-funded PhD studentships. Applicants in the area of the Functional Programming lab (fp.cs.nott.ac.uk) are encouraged! If you are interested in applying, please contact a potential supervisor in the FP lab prior to submitting your application: Thorsten Altenkirch - constructive logic, proof assistants, homotopy type theory, category theory, lambda calculus. Venanzio Capretta - type theory, mathematical logic, corecursive structures, proof assistants, dependently-typed programming. Graham Hutton - not taking on any new students this year. Henrik Nilsson - functional reactive programming, modelling and simulation, domain-specific languages, probabilistic languages. Best wishes, Graham +-----------------------------------------------------------+ 10 Fully-Funded PhD Studentships School of Computer Science University of Nottingham, UK http://tinyurl.com/ten-phds Applications are invited for up to ten fully-funded PhD studentships in the School of Computer Science at the University of Nottingham, starting on 1st October 2015. The topics for the studentships are open, but should relate to the interests of one of the School?s research groups: Agents Lab; Automated Scheduling, Optimisation and Planning; Computer Vision Lab; Functional Programming Lab; Intelligent Modelling and Analysis; Mixed Reality Lab; Networked Systems. The studentships are for three years and include a stipend of ?13,863 per year and tuition fees, and are available to students of any nationality. Applicants are normally expected to have a first-class Masters or Bachelors degree in Computer Science or a related discipline, and must obtain the support of a potential supervisor in the School prior to submitting their application. Initial contact with supervisors should be made at least two weeks prior to the closing date for applications. Informal enquiries may be addressed to . To apply, please submit the following items by email to the above address: (1) a brief covering letter that describes your reasons for wishing to pursue a PhD, your proposed research area and topic, and the name of a potential supervisor; (2) a copy of your CV, including your actual or expected degree class(es), and results of all University examinations; (3) an example of your technical writing, such as a project report or dissertation; (4) contact details for two academic referees. Closing date for applications: 14th January 2015 +-----------------------------------------------------------+ This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From agocorona at gmail.com Tue Dec 2 09:47:49 2014 From: agocorona at gmail.com (Alberto G. Corona ) Date: Tue, 2 Dec 2014 10:47:49 +0100 Subject: [Haskell-cafe] Getting Haskell in the top 20 In-Reply-To: References: <547B55DE.1010104@mcmaster.ca> <2fcp3soarn49sa.fsf@gmail.com> Message-ID: {"irony" : "on"} Haskell as a mainstream language.. what a scandal.... Lots of people using their own EDSLs without passing trough the initiatory cult of Category Theory. To have the benefits without the sacrifices, Tools without religion, fire without Prometeus .... Can you imagine something more unjust and vulgar? We don?t want the success of the haskell language in Industry. We want our own success and to be admired in the distance. 2014-12-01 22:49 GMT+01:00 Markus L?ll : > I thought we were trying to avoid success? > > On Mon, Dec 1, 2014 at 11:42 PM, Alberto G. Corona > wrote: > >> My contribution for today: >> >> haskell programming, haskell programming, haskell programming. >> >> >> 2014-12-01 22:08 GMT+01:00 Alex Hammel : >> >>> Or the Haskell architecture firm, or the Haskell Indian Nations >>> University, or Eddie Haskell the character from Leave it to Beaver, etc. >>> etc. >>> >>> On Mon, Dec 1, 2014 at 12:53 PM, David Thomas >>> wrote: >>> >>>> As opposed to "Haskell golf shoes". >>>> >>>> On Mon, Dec 1, 2014 at 8:25 AM, Kyle Marek-Spartz >>>> wrote: >>>> > The point is that the TIOBE index doesn't track that stuff directly, >>>> but >>>> > indirectly through mentions. If the items you mention result in more >>>> > people talking about "Haskell programming" then it will result in a >>>> > higher index score. >>>> > >>>> > >>>> > Henk-Jan van Tuyl writes: >>>> > >>>> >> Using the words "Haskell" and "programming" in emails probably helps >>>> >> getting Haskell a few places up, but I think there is much more >>>> needed to >>>> >> get it in the top twenty. Things like a GHC backend that produces >>>> Java >>>> >> bytecode and/or Common Intermediate Language, commercial support, or >>>> >> Microsoft delivering Haskell in a Visual Studio environment. These >>>> are >>>> >> things that will raise much more interest in Haskell in the >>>> commercial >>>> >> world, and therefore would also interest more programmers. >>>> >> >>>> >> Regards, >>>> >> Henk-Jan van Tuyl >>>> >> >>>> >> >>>> >> On Sun, 30 Nov 2014 18:37:34 +0100, Jacques Carette < >>>> carette at mcmaster.ca> >>>> >> wrote: >>>> >> >>>> >>> Make sure the actual words "Haskell programming" occur in as many >>>> places >>>> >>> as possible [posts here, on reddit, on stackoverflow, etc]. Not >>>> >>> variants of those words, but those exact words. Like you did in >>>> your >>>> >>> .sig (although that may not be indexed, so it may need to be in the >>>> >>> actual text). >>>> >>> >>>> >>> Get it into people's phrasing that they always speak of "Haskell >>>> >>> programming", not Haskell code, coding, etc, etc. >>>> >>> >>>> >>> Jacques >>>> >>> >>>> >>> On 2014-11-30 11:29 AM, Henk-Jan van Tuyl wrote: >>>> >>>> >>>> >>>> L.S., >>>> >>>> >>>> >>>> In the Tiobe Index[0], F# jumped from position 43 in June to 13 in >>>> July >>>> >>>> and is since than in the >>>> >>>> top twenty. What happened in July and how can we get Haskell in >>>> the top >>>> >>>> 20? >>>> >>>> >>>> >>>> Regards, >>>> >>>> Henk-Jan van Tuyl >>>> >>>> >>>> >>>> >>>> >>>> [0] >>>> http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html >>>> >> >>>> >> -- >>>> >> Folding at home >>>> >> What if you could share your unused computer power to help find a >>>> cure? In >>>> >> just 5 minutes you can join the world's biggest networked computer >>>> and get >>>> >> us closer sooner. Watch the video. >>>> >> http://folding.stanford.edu/ >>>> >> >>>> >> >>>> >> http://Van.Tuyl.eu/ >>>> >> http://members.chello.nl/hjgtuyl/tourdemonad.html >>>> >> Haskell programming >>>> > >>>> > -- >>>> > Kyle Marek-Spartz >>>> > _______________________________________________ >>>> > Haskell-Cafe mailing list >>>> > Haskell-Cafe at haskell.org >>>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> >> -- >> Alberto. >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > Markus L?ll > -- Alberto. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ollie at ocharles.org.uk Tue Dec 2 10:56:59 2014 From: ollie at ocharles.org.uk (Oliver Charles) Date: Tue, 02 Dec 2014 10:56:59 +0000 Subject: [Haskell-cafe] Use distributivity proof in a simple example In-Reply-To: <547D77DC.5090607@well-typed.com> References: <0393AFB2-7F94-4D97-A651-47C6C18C04DF@gmail.com> <547D77DC.5090607@well-typed.com> Message-ID: <87388yjp50.fsf@fynder-widget.localhost> Adam Gundry writes: > -- Now it's easy to define wrap > wrap :: DF xs -> DF (Map [] xs) > wrap Empty = Empty > wrap (Single a) = Single [ a ] > wrap (Cons x y) = case mapDist (toSingleton x) y of > Refl -> Cons (wrap x) (wrap y) Am I right in thinking that you can also use case unsafeCoerce Refl `asTypeOf` mapDist (toSingleton x) of .. to get the same proof, but without any runtime cost? It seems like this might be a nice middle ground. Of course there is a risk that the proof is just wrong, in which case things could awry. Maybe another option is to switch that line with -XCPP macros depending on whether or not you're in "production" mode. - Ollie From alexander at plaimi.net Tue Dec 2 13:39:10 2014 From: alexander at plaimi.net (Alexander Berntsen) Date: Tue, 02 Dec 2014 14:39:10 +0100 Subject: [Haskell-cafe] Haskell 2014 In-Reply-To: <137871417313010@web12h.yandex.ru> References: <137871417313010@web12h.yandex.ru> Message-ID: <547DC0FE.8080101@plaimi.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 I think this discussion should be tightly connected to the GHC LTS discussion. A LTS GHC release and a Haskell standard would be a very happy marriage. If they then were to renew their vows every now and again, Haskell would be a lot more attractive for industry. - -- Alexander alexander at plaimi.net https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlR9wP4ACgkQRtClrXBQc7V4gAD+OBOXgTF0Vb14L61JMnYJWoWH ylQD6GYlcNSewHG8O2QBAIzkThM7g1ZNdLWO4RaoNNl93Gx5kyK/mUwAPrHaVtLH =P/Dt -----END PGP SIGNATURE----- From oleg at okmij.org Tue Dec 2 15:31:35 2014 From: oleg at okmij.org (oleg at okmij.org) Date: Tue, 2 Dec 2014 10:31:35 -0500 (EST) Subject: [Haskell-cafe] extensible effects and open unions In-Reply-To: <87h9xjzm7t.fsf_-_@chaos.shergill.su> Message-ID: <20141202153135.A1518C3854@www1.g3.pair.com> First of all, thank you indeed for taking over as the maintainer of the extensible-effects library. Thank you for sending me your questions directly. > 1] the use/need for Typeable in Data.OpenUnion > > > I must stress that OpenUnion1.hs described (briefly) in the paper is > > only one implementation of open unions, out of many possible. For > > example, I have two more implementations. A year-old version of the > > code implemented open unions *WITHOUT* overlapping instances or > > Typeable. > > http://okmij.org/ftp/Haskell/extensible/TList.hs > > how does the TList.hs implementation compare with, say, OpenUnion2.hs? > neither require OverlappingInstances, and the TList implementation > also does away with the Typeable constraint. are there reasons why it > might not make sense to use TList.hs as the only/default > implementation of Data.OpenUnion? Although TList doesn't require neither overlapping instances nor Typeable, it is not so easy to use since one has to `register' any new type or effects. To show that one can indeed implement the interface of OpenUnion.hs as it is *without* Typeable or overlapping instances, I have just written http://okmij.org/ftp/Haskell/extensible/OpenUnion4.hs It is meant to be a drop-in replacement for OpenUnion2.hs. At least for my Eff code, it does indeed act that way. Nothing in the code has to be changed save for the import declaration. On the down side, in OpenUnion4.hs, projections and injections take linear time in the size of the union. How much difference it really makes in practice is unclear (since the projection and injection operations can be computed statically). Only benchmarks could tell. > 2] scope for impredicative/first-class polymorphism > > > By polymorphic effects you must mean first-class polymorphism (because > > the already implemented Reader effect is polymorphic in the > > environment). First of all, there are workarounds. > > what are the "workarounds" in question? Well, OpenUnion4 is one workaround. Since it does not use Typeable, there are no problems with (ST s)--like types. > the paper mentioned "explicitly marking state, and providing an > allocation system using monadic regions". is this related to > and if so, > what work needs to be done to apply those ideas to extensible-effects? I'm afraid that the answer is `just do it'. I thought about the implementation and jotted down some notes somewhere. There didn't seem to be any significant problems. Alas I hadn't have the time since to pursue this further. Thank you! From marco.vax91 at gmail.com Tue Dec 2 15:40:40 2014 From: marco.vax91 at gmail.com (Marco Vassena) Date: Tue, 2 Dec 2014 16:40:40 +0100 Subject: [Haskell-cafe] Use distributivity proof in a simple example In-Reply-To: <547D77DC.5090607@well-typed.com> References: <0393AFB2-7F94-4D97-A651-47C6C18C04DF@gmail.com> <547D77DC.5090607@well-typed.com> Message-ID: Hi Adam, Thank you very much for your help and for the reference. Singleton types were exactly what I needed. Cheers, Marco On 02/dic/2014, at 09.27, Adam Gundry wrote: > Hi Marco, > > I think typeclasses are a bit of a red herring here: the problem, as you > observed, is that it isn't possible to write a useful term of type > > proof :: forall xs ys zs . Append xs ys ~ zs > => Proxy xs -> Proxy ys -> Proxy zs > -> Append (Map [] xs) (Map [] ys) :~: Map [] zs > > because the runtime behaviour of proof (i.e. the program that constructs > the witness to the equality) must depend on xs. (With typeclasses, the > unsolved constraint of type `MapDist xs` amounts to needing this > argument to be passed at runtime; having the two cases covered by class > instances isn't enough.) > > The nice way to solve this problem would be to use a dependent product > (pi-type), which would allow a single argument to be used both in types > (like forall) and at runtime (like normal functions). Unfortunately, > Haskell doesn't support pi-types (yet...) but we can fake them with a > standard trick known as "singleton types", like this: > > -- The singleton type of lists, which allows us to take a list as a > -- term-level and a type-level argument at the same time (although > -- we're not interested in the elements here, only the structure) > data SList xs where > SNil :: SList '[] > SCons :: SList xs -> SList (x ': xs) > > -- Now mapDist takes xs at runtime but ys/zs only at compile time > mapDist :: zs ~ Append xs ys > => SList xs -> proxy ys > -> Append (Map [] xs) (Map [] ys) :~: Map [] zs > mapDist SNil _ = Refl > mapDist (SCons l) p = apply Refl (mapDist l p) > > -- Connect term-level and type-level list append > append :: SList xs -> SList ys -> SList (Append xs ys) > append SNil ys = ys > append (SCons xs) ys = SCons (append xs ys) > > -- Convert your DF type into a list > toSingleton :: DF xs -> SList xs > toSingleton Empty = SNil > toSingleton (Single _) = SCons SNil > toSingleton (Cons xs ys) = append (toSingleton xs) (toSingleton ys) > > -- Now it's easy to define wrap > wrap :: DF xs -> DF (Map [] xs) > wrap Empty = Empty > wrap (Single a) = Single [ a ] > wrap (Cons x y) = case mapDist (toSingleton x) y of > Refl -> Cons (wrap x) (wrap y) > > If you're interested in this technique, Richard and Jan's excellent > "singletons" library [1] and accompanying paper take it much further. > > Hope this helps, > > Adam > > > [1] http://hackage.haskell.org/package/singletons > > > On 02/12/14 01:28, Marco Vassena wrote: >> My GADT data type is indexed over type level list. >> >> data DF (xs :: [ * ]) where >> Empty :: DF [] >> Single :: a -> DF '[ a ] >> Cons :: DF xs -> DF ys -> DF (Append xs ys) >> >> Append is a type family that append two type level lists: >> type family Append (xs :: [ * ]) (ys :: [ * ]) :: [ * ] where >> Append '[] ys = ys >> Append (x ': xs) ys = x ': Append xs ys >> >> Map is a type level map: >> type family Map (f :: * -> *) (xs :: [ * ]) :: [ * ] where >> Map f '[] = '[] >> Map f (x ': xs) = f x ': Map f xs >> >> Now I want to write a function that wraps all the component in Single in a list: >> wrap :: DF xs -> DF (Map [] xs) >> wrap Empty = Empty >> wrap (Single a) = Single [ a ] >> wrap (Cons x y) = Cons (wrap x) (wrap y) -- Type Error >> >> The type-checker doesn't know anything about distributivity: >> Could not deduce (Append (Map [] xs) (Map [] ys) ~ Map [] zs) >> from the context (zs ~ Append xs ys) >> >> I managed to prove this property by induction on the first type level list. >> >> class MapDist xs where >> mapDist :: (zs ~ Append xs ys) => Proxy xs -> Proxy ys -> Append (Map [] xs) (Map [] ys) :~: Map [] zs >> >> instance MapDist '[] where >> mapDist Proxy Proxy = Refl >> >> tailP :: Proxy (x ': xs) -> Proxy xs >> tailP _ = Proxy >> >> instance MapDist xs => MapDist (x ': xs) where >> mapDist p1 p2 = >> case mapDist (tailP p1) p2 of >> Refl -> Refl >> >> I have adjusted wrap as follows: >> >> toProxy :: DataFormat xs -> Proxy xs >> toProxy _ = Proxy >> >> wrap (Cons x y) = >> let p1 = toProxy x >> p2 = toProxy y in >> case mapDist p1 p2 of >> Refl -> Cons (wrap x) (wrap y) >> >> The problem now is that MapDist xs is not in the context. >> Adding it to the Cons constructor in the GADT definition does not solve the problem: >> Could not deduce (MapDist (Map [] xs)) ... >> >> How can I solve this issue? >> Clearly the two instances of MapDist cover all possible cases, and therefore it should be possible >> to use it for any list xs. >> >> I tried avoiding the type class MapDist with a normal function: >> proof :: forall xs ys zs . Append xs ys ~ zs => >> Proxy xs -> Proxy ys -> Proxy zs -> >> Append (Map [] xs) (Map [] ys) :~: Map [] zs >> >> However here I have no mean to distinguish the base case ('[]) from >> the inductive case (x ': xs), thus I cannot complete the proof. >> >> Do you have any idea, suggestion or workaround for this kind of situations? >> >> Cheers, >> Marco > > > -- > Adam Gundry, Haskell Consultant > Well-Typed LLP, http://www.well-typed.com/ From adam at well-typed.com Tue Dec 2 15:58:15 2014 From: adam at well-typed.com (Adam Gundry) Date: Tue, 02 Dec 2014 15:58:15 +0000 Subject: [Haskell-cafe] Use distributivity proof in a simple example In-Reply-To: <87388yjp50.fsf@fynder-widget.localhost> References: <0393AFB2-7F94-4D97-A651-47C6C18C04DF@gmail.com> <547D77DC.5090607@well-typed.com> <87388yjp50.fsf@fynder-widget.localhost> Message-ID: <547DE197.2080304@well-typed.com> Hi Ollie, On 02/12/14 10:56, Oliver Charles wrote: > Adam Gundry writes: > >> -- Now it's easy to define wrap >> wrap :: DF xs -> DF (Map [] xs) >> wrap Empty = Empty >> wrap (Single a) = Single [ a ] >> wrap (Cons x y) = case mapDist (toSingleton x) y of >> Refl -> Cons (wrap x) (wrap y) > > Am I right in thinking that you can also use > > case unsafeCoerce Refl `asTypeOf` mapDist (toSingleton x) of > .. > > to get the same proof, but without any runtime cost? It seems like this > might be a nice middle ground. Of course there is a risk that the proof > is just wrong, in which case things could awry. Maybe another option is > to switch that line with -XCPP macros depending on whether or not you're > in "production" mode. Well, yes, but it rather depends what you mean by "the same proof". Certainly you can write unsafeCoerce, save some CPU cycles and nothing bad will happen in this case, because mapDist is total. There's nothing to enforce that, however. This is where having a totality checker (like in Agda or Idris) really helps: the compiler can safely erase known-total proof terms. In Haskell, I can write down the "proof" bad :: a :~: b bad = bad which will lead to a safe infinite loop if evaluated, but if I'm just blindly trusting it using unsafeCoerce, it will give me... well, unsafeCoerce. I can certainly understand the temptation to write proof terms in development and replace them with unsafeCoerce in production, though. You just need a good test suite. ;-) Happy Advent, Adam -- Adam Gundry, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/ From dominic at steinitz.org Tue Dec 2 15:55:38 2014 From: dominic at steinitz.org (Dominic Steinitz) Date: Tue, 2 Dec 2014 15:55:38 +0000 Subject: [Haskell-cafe] Julia and Charts on Mac In-Reply-To: <2fcp3sa9364rra.fsf@gmail.com> References: <73585950-B269-49FC-998E-188891402644@steinitz.org> <87r3wjfghn.fsf@gmail.com> <2fcp3sa9364rra.fsf@gmail.com> Message-ID: Cool - I did not know that - thanks for sharing Dominic Steinitz dominic at steinitz.org http://idontgetoutmuch.wordpress.com On 2 Dec 2014, at 04:09, Kyle Marek-Spartz wrote: > If you use Homebrew Cask (http://caskroom.io/), you can: > > brew cask install ghc > > which uses the ghcformacosx.github.io installer. > > There's also installers in Cask for e.g. Leksah and some other useful > Haskell tools. > > > Carter Schonwald writes: > >> on the OS X ease of install front, ghcformacosx.github.io is a bit easier >> to do that homebrew (or at least in my opinionated opinion), and has much >> better zeroconfig / isolation >> >> On Mon, Dec 1, 2014 at 12:05 PM, Ben Gamari wrote: >> >>> Dominic Steinitz writes: >>> >>>> I just had an interesting experience installing the Julia charts >>>> package (Gadfly based on ggplot) on my Mac which I thought I would >>>> share as I know I and other folk have had trouble getting diagrams / >>>> Cairo to work on Macs. >>>> >>> I agree that the current cairo situation could be improved. The fact that >>> gtk2hs can't properly depend upon gtk2hs-buildtools means that nearly >>> anyone who needs to needs to install any Cairo-based package with >>> Cabal has at very least one non-trivial hoop to jump through. In my >>> experience this is often only the first of several. >>> >>> This has always perplexed me as Cairo isn't glib-based, unlike the other >>> members of the gtk2hs family. Binding to Cairo should (as far as I know) >>> be no harder than binding to any other pure C library. It seems like the >>> situation could be improved substantially by simply splitting cairo out >>> of gtk2hs, using standard FFI code generation tools (bindings-dsl works >>> pretty well in my experience, although plain hsc2hs is also acceptable), >>> and simplifying its build system. >>> >>> That being said, part of me thinks that the days of Cairo being dominant >>> means of drawing are numbered. Diagrams can produce SVG without any help >>> From Cairo and Chart can now use diagrams as its backend. I would hope >>> that installation of pure Haskell libraries would be no harder than >>> Julia's process. >>> >>> The only reason I can think of why this wouldn't be the case is Cabal >>> hell. While Julia may not suffer from package-hell yet (due to the young >>> age and batteries-included nature of the distribution) they will >>> inevitably need to deal with it at some point. >>> >>>> It installs homebrew and then all the required packages from its own >>>> repo (not sure what the homebrew terminology is for this - possibly a >>>> brewery?) so presumably guaranteeing that the installation is >>>> consistent and ?just works?. I must say I was a bit surprised (I think >>>> I would have liked it to tell me what it was about to do) but it was >>>> entirely painless and I drew my first chart after less than 5 minutes. >>>> >>> Sounds like quite a pleasant process. It's a shame there isn't more >>> community interest in maintaining a Haskell homebrew repository. It >>> seems like this could substantially improve the OS X support story. >>> >>>> PS I am not sure that haskell-cafe is the right list to share this on >>>> but as we don?t have a mailing list for numerical stuff or mac >>>> stuff... >>> >>> I appreciated the post. >>> >>> Cheers, >>> >>> - Ben >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- > Kyle Marek-Spartz From vigalchin at gmail.com Tue Dec 2 17:26:48 2014 From: vigalchin at gmail.com (Vasili I. Galchin) Date: Tue, 2 Dec 2014 11:26:48 -0600 Subject: [Haskell-cafe] Haskell and SCADA Message-ID: http://en.m.wikipedia.org/wiki/SCADA ,,,, this post is in particular for people who are somewhat familliar with SCADA. Question: are SCADA hardware processors running anything like an operating system that would allow software to be written in Haskell?? Vasili -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Tue Dec 2 17:37:35 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 2 Dec 2014 12:37:35 -0500 Subject: [Haskell-cafe] Haskell and SCADA In-Reply-To: References: Message-ID: something like http://ivorylang.org/ivory-introduction.html (which is written in haskell) is relevant for those sorts of control systems I think On Tue, Dec 2, 2014 at 12:26 PM, Vasili I. Galchin wrote: > http://en.m.wikipedia.org/wiki/SCADA ,,,, this post is in particular for > people who are somewhat familliar with SCADA. > > Question: are SCADA hardware processors running anything like an operating > system that would allow software to be written in Haskell?? > > Vasili > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok at cs.otago.ac.nz Tue Dec 2 23:01:52 2014 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Wed, 3 Dec 2014 12:01:52 +1300 Subject: [Haskell-cafe] Getting Haskell in the top 20 In-Reply-To: <2fcp3soarn49sa.fsf@gmail.com> References: <547B55DE.1010104@mcmaster.ca> <2fcp3soarn49sa.fsf@gmail.com> Message-ID: <87DB7AD5-1B69-47FC-8B36-29EFDD795B21@cs.otago.ac.nz> Y?know, there?s a _reason_ for ?avoid success at all costs?. I believe it was Nietzsche who wrote "Man is a thing to be overcome. What are you doing to overcome him?? Well, *Haskell* is a thing to be overcome. Or to put it less bleakly, it?s a journey, not a destination. If you look at things like C++ and Java, you see amongst other things wilful flouting of practically everything that was learned in the 70s about language design and an intolerable mountain of cruft heaped ever higher because with a ?successful? language it is hard to take anything away. Heck, Java was supposed to be a C++ restart, but it kept way too many of the old mistakes. Haskell is all about learning how to do better, all the time. From scottmurphy09 at gmail.com Wed Dec 3 14:54:34 2014 From: scottmurphy09 at gmail.com (Scott Murphy) Date: Wed, 3 Dec 2014 06:54:34 -0800 (PST) Subject: [Haskell-cafe] Haskell and SCADA In-Reply-To: References: Message-ID: <650fde8c-dc51-4dc8-b5ce-6a86274da95b@googlegroups.com> SCADA processors use a variety of different platforms. Some run as soft devices, these allow you to run other programs in the background. But industrial control SCADA-Pak style devices are written embedded hard or with custom RTOS. To write in haskell you would have to get access to the firmware. Some manufacturers will let you do this but you have to sign NDA and stuff. On Tuesday, December 2, 2014 11:26:56 AM UTC-6, Vasili I. Galchin wrote: > > http://en.m.wikipedia.org/wiki/SCADA ,,,, this post is in particular for > people who are somewhat familliar with SCADA. > > Question: are SCADA hardware processors running anything like an operating > system that would allow software to be written in Haskell?? > > Vasili > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.tetley at gmail.com Wed Dec 3 22:30:44 2014 From: stephen.tetley at gmail.com (Stephen Tetley) Date: Wed, 3 Dec 2014 22:30:44 +0000 Subject: [Haskell-cafe] Haskell and SCADA In-Reply-To: References: Message-ID: SCADA (or PLC code at least) is often generated from graphical ladder diagrams. It would be easy to believe a Haskell embedded DSL would be more flexible than a visual programming language, but the people writing PLC code are already comfortable with their tools. Haskell would be a big change [*]. [*] I currently work in the water industry in the UK - the people configuring SCADA and writing PLC code are hardware engineers not programmers. Programming is just something they need to do to get the system working, they aren't sitting around dreaming after better programming tools. On 2 December 2014 at 17:26, Vasili I. Galchin wrote: > http://en.m.wikipedia.org/wiki/SCADA ,,,, this post is in particular for > people who are somewhat familliar with SCADA. > > Question: are SCADA hardware processors running anything like an operating > system that would allow software to be written in Haskell?? > > Vasili > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From michael at snoyman.com Thu Dec 4 10:14:37 2014 From: michael at snoyman.com (Michael Snoyman) Date: Thu, 04 Dec 2014 10:14:37 +0000 Subject: [Haskell-cafe] Stackage survey Message-ID: Please fill out the Stackage survey, targeted at both Haskell library authors and users. It's just a few multiple choice questions, and shouldn't take you more than 1-2 minutes to complete.? http://goo.gl/forms/J1xaWV9BOR -------------- next part -------------- An HTML attachment was scrubbed... URL: From g9ks157k at acme.softbase.org Thu Dec 4 16:42:50 2014 From: g9ks157k at acme.softbase.org (Wolfgang Jeltsch) Date: Thu, 04 Dec 2014 18:42:50 +0200 Subject: [Haskell-cafe] Array creation in constant time Message-ID: <1417711370.3511.17.camel@idefix> Hi, I want to create an array without initializing its elements, so that array creation takes constant time (modulo heap management). What are possible approaches for this? I thought about using newArray_ with the IOUArray type. Is this guaranteed to not initialize any elements and run in O(1)? Are there other ways? All the best, Wolfgang From spam at scientician.net Thu Dec 4 16:48:40 2014 From: spam at scientician.net (Bardur Arantsson) Date: Thu, 04 Dec 2014 17:48:40 +0100 Subject: [Haskell-cafe] Hackage documentation for executables Message-ID: Hi all, I'm trying to upload documentation for an executable-only package to Hackage, but I can't get Haddock syntax to work in the description field. Here's the previous upload: http://hackage.haskell.org/package/pg-harness-0.1.0 As you can see, the "@" bits haven't been respected, nor have the ">" sections. Is there something I can do to fix this? (I guess I might upload the documentation myself, but I'd obviously prefer if I could avoid that.) (I'm trying to upload a new version, but I'd like to know what to first to avoid this issue.) Regards, From lykahb at gmail.com Thu Dec 4 17:07:25 2014 From: lykahb at gmail.com (Boris Lykah) Date: Thu, 4 Dec 2014 12:07:25 -0500 Subject: [Haskell-cafe] ANN: Groundhog-inspector, a tool for generating datatypes from database Message-ID: Hello everyone, I am pleased to announce groundhog-inspector. It analyzes database schema and creates corresponding datatypes and mapping configuration for Groundhog. It works with PostgreSQL, MySQL, and Sqlite. Composite keys, constraints, references across schemas, and other details of schema are reflected in the output. Groundhog-inspector can be used as a library and provides a standalone tool for simple scenarios. Here is an example of the standalone tool usage. JSON mapping in the output was manually converted to YAML for brevity. $ sqlite3 dbfile "CREATE TABLE mytable (id INTEGER PRIMARY KEY NOT NULL, str VARCHAR NOT NULL, ref INTEGER references mytable)" $ groundhog_inspector sqlite dbfile data Mytable = Mytable {mytableStr :: String, mytableRef :: (Maybe (AutoKey Mytable))} - entity: "Mytable" dbName: "mytable" constructors: - name: "Mytable" fields: - name: "mytableStr" dbName: "str" - name: "mytableRef" dbName: "ref" * [Hackage] (http://hackage.haskell.org/package/groundhog-inspector) * [GitHub] ( https://github.com/lykahb/groundhog/tree/master/groundhog-inspector/examples ) I would be happy to answer the questions. Enjoy! Regards, Boris Lykah -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Thu Dec 4 19:53:33 2014 From: david.feuer at gmail.com (David Feuer) Date: Thu, 4 Dec 2014 14:53:33 -0500 Subject: [Haskell-cafe] Looking for help finishing off Data.Sequence <*> optimization Message-ID: With help from Carter Schonwald, I've put together a framework to optimize both the zip functions and the (<*>) method for sequences, as shown in https://github.com/haskell/containers/pull/84 The zip optimization is complete, but I'm getting lost in modular arithmetic in the optimization of fs<*>xs. The remaining challenge is to come up with an efficiently splittable representation of fmap (\f -> fmap f xs) fs and a way to split it. The first part, coming up with a representation that (theoretically) does the job, is easy: data CP a b = SingleCP a (Seq b) | FullCP Int Int (Seq a) (Seq b) The SingleCP constructor represents [f] * xs; the FullCP one holds fs, xs, and the start and end points within the original sequence (this representation was half-heartedly suggested by Cale Gibbard, who thinks probably no one uses the Applicative instance for Seq anyway). The trouble is that actually calculating things properly with these numbers is rather confusing for me; I keep going off by one in one way or another, and producing unreadable code. Can anyone help? David Feuer -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart.hungerford at gmail.com Fri Dec 5 01:31:05 2014 From: stuart.hungerford at gmail.com (Stuart Hungerford) Date: Fri, 5 Dec 2014 12:31:05 +1100 Subject: [Haskell-cafe] 2D symmetry groups implementation in Haskell? Message-ID: Hi, As per the subject line--does anyone know of any implementations of 2D (planar) symmetry groups in Haskell? (i.e. "rosette", "frieze" and "wallpaper") groups? I've looked in Hackage but as a complete Haskell novice may not being looking in the right places or communities. Many thanks, Stu From ovidiudeac at gmail.com Fri Dec 5 06:21:34 2014 From: ovidiudeac at gmail.com (Ovidiu Deac) Date: Fri, 5 Dec 2014 08:21:34 +0200 Subject: [Haskell-cafe] Haskell CAD DSL Message-ID: Is there any Haskell-based CAD DSL? I found ImplicitCAD (http://www.implicitcad.org/) which has an Haskell API but the project seems dead as there is no activity on their github repository for the last 2 years. Are there any other options? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mwm at mired.org Fri Dec 5 07:04:31 2014 From: mwm at mired.org (Mike Meyer) Date: Fri, 5 Dec 2014 01:04:31 -0600 Subject: [Haskell-cafe] Haskell CAD DSL In-Reply-To: References: Message-ID: My Graphics.OpenSCAD is a DSL for OpenSCAD. Well, it's actually a Haskell data type along with some support functions, because I prefer Haskell syntax to OpenSCAD's syntax. I've got code to verify that polygons and polyhedra are correct, but to compile on 7.8 that needs bed-and-breakfast 0.5, which hasn't been published yet. I need to pull that code into the project and update it, but have been distracted by other things recently. On Fri, Dec 5, 2014 at 12:21 AM, Ovidiu Deac wrote: > Is there any Haskell-based CAD DSL? > > I found ImplicitCAD (http://www.implicitcad.org/) which has an Haskell > API but the project seems dead as there is no activity on their github > repository for the last 2 years. > > Are there any other options? > > Thanks! > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christiaan.baaij at gmail.com Fri Dec 5 11:20:24 2014 From: christiaan.baaij at gmail.com (Christiaan Baaij) Date: Fri, 5 Dec 2014 12:20:24 +0100 Subject: [Haskell-cafe] Reminder: Dutch functional programming day (NL-FP 2015) Message-ID: <4D4FE72B-4769-41C9-AF4E-4FA190ED489C@gmail.com> Hi everyone, This is a reminder that the next annual Dutch Functional Programming day will take place on: Friday, January 9th, 2015 at the the University of Twente, Enschede, The Netherlands. You are all invited to participate, and of course, to give a presentation. The day will end with a joint dinner. Some additional information: - Although it is called the dutch functional programming day, the program will be in english. - Participation for the day itself is free of charge; we expect dinner to cost around 25 euro. In order to make the necessary reservations, we would like to know as soon as possible how many people we may expect. More information, and the online registration form, can be found at: http://wwwhome.cs.utwente.nl/~jankuper/fp-dag/ Hope to meet you all in Twente at the next FP day! Cheers, Christiaan Baaij From hjgtuyl at chello.nl Fri Dec 5 20:04:56 2014 From: hjgtuyl at chello.nl (Henk-Jan van Tuyl) Date: Fri, 05 Dec 2014 21:04:56 +0100 Subject: [Haskell-cafe] HaskellWiki Message-ID: L.S., Regarding the HaskellWiki: I am missing the colorization of differences in the "Difference between revisions" pages for some time, and now I see that the number of page views is not displayed anymore. Can we get those features back? Regards, Henk-Jan van Tuyl -- Folding at home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming -- From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Sat Dec 6 20:01:13 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Sat, 6 Dec 2014 20:01:13 +0000 Subject: [Haskell-cafe] No warning for unused import on first line Message-ID: <20141206200113.GB26130@weber> Using GHC 7.6.3, if I have ``` import Data.List main :: IO () main = return () ``` then I get a warning as expected. ``` % ghc -fforce-recomp -Wall test1.hs [1 of 1] Compiling Main ( test1.hs, test1.o ) test1.hs:2:1: Warning: The import of `Data.List' is redundant except perhaps to import instances from `Data.List' To import instances alone, use: import Data.List() Linking test1 ... ``` However, if `import Data.List` appears on the first line, i.e. with no blank line at the top of the file ``` import Data.List main :: IO () main = return () ``` then I get no warning. ``` % ghc -fforce-recomp -Wall test1.hs [1 of 1] Compiling Main ( test1.hs, test1.o ) Linking test1 ... ``` Can anyone explain this? Tom From trebla at vex.net Sat Dec 6 20:57:04 2014 From: trebla at vex.net (Albert Y. C. Lai) Date: Sat, 06 Dec 2014 15:57:04 -0500 Subject: [Haskell-cafe] No warning for unused import on first line In-Reply-To: <20141206200113.GB26130@weber> References: <20141206200113.GB26130@weber> Message-ID: <54836DA0.5030708@vex.net> On 2014-12-06 03:01 PM, Tom Ellis wrote: > However, if `import Data.List` appears on the first line, i.e. with no > blank line at the top of the file [...] > then I get no warning. I cannot explain this. But I have checked that 7.8.3 does not have the same problem. From fabian.bergmark at gmail.com Sun Dec 7 05:48:47 2014 From: fabian.bergmark at gmail.com (Fabian Bergmark) Date: Sun, 7 Dec 2014 15:48:47 +1000 Subject: [Haskell-cafe] ECMA262 (Javascript) interpreter Message-ID: I have been implementing an ECMA-262 (Javascript) interpreter over the last few weeks. I have been following http://www.ecma-international.org/ecma-262/5.1 and tried to keep my implementation as close to the specification as possible. The code can be found here https://github.com/fabianbergmark/ECMA-262 So far I have implemented the core language, but has yet to write all the specification functions (Array.splice, String.substring etc.). Before I do this and release it on hackage, I would appreciate feedback on my implementation. The issues I see at the time are: * The parser is slow for deeply nested code * Strict mode is not implemented * Interpret.hs is ~ 6k lines * SubType.hs uses IncoherentInstances, and a better implementation would be nice. At the moment it works but for one case. To test the code, install the cabal package and run ecma262 on a .js file. One host object, console.log is provided and prints to stdout. Fabian Bergmark From achudnov at gmail.com Sun Dec 7 06:23:58 2014 From: achudnov at gmail.com (Andrey Chudnov) Date: Sun, 07 Dec 2014 01:23:58 -0500 Subject: [Haskell-cafe] ECMA262 (Javascript) interpreter In-Reply-To: References: Message-ID: <5483F27E.3060105@gmail.com> 1) Does it pass test-262? 2) I see you have implemented your own parser and AST? Have you looked at the other packages implementing/trying to implement that? On 12/07/2014 12:48 AM, Fabian Bergmark wrote: > I have been implementing an ECMA-262 (Javascript) interpreter over the > last few weeks. I have been following > http://www.ecma-international.org/ecma-262/5.1 and tried to keep my > implementation as close to the specification as possible. > > The code can be found here https://github.com/fabianbergmark/ECMA-262 > > So far I have implemented the core language, but has yet to write all > the specification functions (Array.splice, String.substring etc.). > Before I do this and release it on hackage, I would appreciate > feedback on my implementation. > > The issues I see at the time are: > > * The parser is slow for deeply nested code > * Strict mode is not implemented > * Interpret.hs is ~ 6k lines > * SubType.hs uses IncoherentInstances, and a better implementation > would be nice. At the moment it works but for one case. > > To test the code, install the cabal package and run ecma262 on a .js > file. One host object, console.log is provided and prints to stdout. > > Fabian Bergmark > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From fabian.bergmark at gmail.com Sun Dec 7 06:35:10 2014 From: fabian.bergmark at gmail.com (Fabian Bergmark) Date: Sun, 7 Dec 2014 16:35:10 +1000 Subject: [Haskell-cafe] ECMA262 (Javascript) interpreter In-Reply-To: <5483F27E.3060105@gmail.com> References: <5483F27E.3060105@gmail.com> Message-ID: I based my work on HJS, but realized that it deviated to much from the specification for me to patch it with the features I want. Im aware of the test-262 test suit and have used it to do some casual testing. Before I release my package to hackage I will make sure it passes 2014-12-07 16:23 GMT+10:00 Andrey Chudnov : > 1) Does it pass test-262? > 2) I see you have implemented your own parser and AST? Have you looked at > the other packages implementing/trying to implement that? > > > On 12/07/2014 12:48 AM, Fabian Bergmark wrote: >> >> I have been implementing an ECMA-262 (Javascript) interpreter over the >> last few weeks. I have been following >> http://www.ecma-international.org/ecma-262/5.1 and tried to keep my >> implementation as close to the specification as possible. >> >> The code can be found here https://github.com/fabianbergmark/ECMA-262 >> >> So far I have implemented the core language, but has yet to write all >> the specification functions (Array.splice, String.substring etc.). >> Before I do this and release it on hackage, I would appreciate >> feedback on my implementation. >> >> The issues I see at the time are: >> >> * The parser is slow for deeply nested code >> * Strict mode is not implemented >> * Interpret.hs is ~ 6k lines >> * SubType.hs uses IncoherentInstances, and a better implementation >> would be nice. At the moment it works but for one case. >> >> To test the code, install the cabal package and run ecma262 on a .js >> file. One host object, console.log is provided and prints to stdout. >> >> Fabian Bergmark >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > From ovidiudeac at gmail.com Sun Dec 7 14:09:01 2014 From: ovidiudeac at gmail.com (Ovidiu Deac) Date: Sun, 7 Dec 2014 16:09:01 +0200 Subject: [Haskell-cafe] Haskell CAD DSL In-Reply-To: References: Message-ID: I'll take a look. Thanks! On Fri, Dec 5, 2014 at 9:04 AM, Mike Meyer wrote: > My Graphics.OpenSCAD is a DSL for OpenSCAD. Well, it's actually a Haskell > data type along with some support functions, because I prefer Haskell > syntax to OpenSCAD's syntax. > > I've got code to verify that polygons and polyhedra are correct, but to > compile on 7.8 that needs bed-and-breakfast 0.5, which hasn't been > published yet. I need to pull that code into the project and update it, but > have been distracted by other things recently. > > On Fri, Dec 5, 2014 at 12:21 AM, Ovidiu Deac wrote: > >> Is there any Haskell-based CAD DSL? >> >> I found ImplicitCAD (http://www.implicitcad.org/) which has an Haskell >> API but the project seems dead as there is no activity on their github >> repository for the last 2 years. >> >> Are there any other options? >> >> Thanks! >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamish.k.mackenzie at gmail.com Mon Dec 8 03:18:10 2014 From: hamish.k.mackenzie at gmail.com (Hamish Mackenzie) Date: Mon, 8 Dec 2014 16:18:10 +1300 Subject: [Haskell-cafe] Announce: Leksah 0.14.3 Message-ID: <3AFCA07E-565B-4BF6-8B5B-F8E7FF0AF06B@gmail.com> Download it here https://github.com/leksah/leksah/wiki/download If you have not tried Leksah recently here are some things that are new(ish). If you have GHCJS installed you can build and run your applications in Leksah's output pane. https://www.youtube.com/watch?v=zQnExdDL63c There is also a WebKit "Web Inspect" pane built in (Right click in the Output pane and select Inspect Element). Windows and OS X binaries now use Gtk 3.14. Windows installer includes all the Gtk+-3.0 files you need to build Gtk2Hs applications (including Leksah). From atze at uu.nl Mon Dec 8 09:04:13 2014 From: atze at uu.nl (Atze Dijkstra) Date: Mon, 8 Dec 2014 10:04:13 +0100 Subject: [Haskell-cafe] [Haskell] ANNOUNCE: Applied Functional Programming (AFP) Summerschool 6-17 July 2015, Utrecht, Netherlands Message-ID: <34196EDA-74C3-4A2E-94E0-BE69028E43B1@uu.nl> =========== AFP Summerschool 2015 =========== Applied Functional Programming (AFP) Summerschool July 6-17, 2015 Utrecht University, Department of Information and Computing Sciences Utrecht, The Netherlands Summerschool & registration website: http://www.utrechtsummerschool.nl/courses/science/applied-functional-programming-in-haskell AFP website : http://www.cs.uu.nl/wiki/USCS contact : Uscs-afp at lists.science.uu.nl *** The 2015 edition of the Applied Functional Programming (AFP) Summerschool in Utrecht, Netherlands will be held from 6-17 July 2015. The summerschool teaches Haskell on both beginners and advanced levels via lectures and lab exercises. More info can be found via the references above, included here is a summary from the summerschool info: ``Typed functional programming in Haskell allows for the development of compact programs in minimal time and with maximal guarantees about robustness and correctness. The course introduces Haskell as well as its theoretical underpinnings such as typed lambda calculus, and Damas-Milner type inference. There is ample opportunity to put this all in practice during lab sessions. Typed functional programming languages allow for the development of robust, concise programs in a short amount of time. The key advantages are higher-order functions as an abstraction mechanism, and an advanced type system for safety and reusability. This course introduces Haskell, a state-of-the-art functional programming language, together with some of its theoretical background, such as typed lambda calculi, referential transparency, Damas-Milner type inference, type level programming, and functional design patterns. We will combine this with applications of functional programming, concentrating on topics such as language processing, building graphical user interfaces, networking, databases, and programming for the web. The goal of the course is not just to teach the programming language and underlying theory, but also to learn about the Haskell community and to get hands-on experience by doing lab exercises or a Haskell project of your own.'' *** This year is somewhat special in that the Tour de France starts in Utrecht the weekend before the start of the summerschool. It is an opportunity for enjoying the related festivities. It also implies that housing may be more difficult the weekend before the summerschool, something to keep in mind when you wait with registration until the latest. regards, - Atze - Atze Dijkstra, Department of Information and Computing Sciences. /|\ Utrecht University, PO Box 80089, 3508 TB Utrecht, Netherlands. / | \ Tel.: +31-30-2534118/1454 | WWW : http://www.cs.uu.nl/~atze . /--| \ Fax : +31-30-2513971 .... | Email: atze at uu.nl ............... / |___\ _______________________________________________ Haskell mailing list Haskell at haskell.org http://www.haskell.org/mailman/listinfo/haskell From tdammers at gmail.com Mon Dec 8 12:59:30 2014 From: tdammers at gmail.com (Tobias Dammers) Date: Mon, 8 Dec 2014 13:59:30 +0100 Subject: [Haskell-cafe] ECMA262 (Javascript) interpreter In-Reply-To: References: Message-ID: <20141208125914.GA22040@nibbler> I'm kind of fiddling with solving the same (almost) problem, but since you seem to have done most of the heavy lifting already, I'd like to know whether your implementation could fit my needs. Specifically, my use case is that I want to use JavaScript as a scripting language for a host application written in Haskell; this could be a game, or a CMS/blogging platform, or anything else that needs scripting; one of the must-have requirements is to parametrize the interpreter over arbitrary monads, such that it can be sandboxed into whatever monad stack you need to script over. On Sun, Dec 07, 2014 at 03:48:47PM +1000, Fabian Bergmark wrote: > I have been implementing an ECMA-262 (Javascript) interpreter over the > last few weeks. I have been following > http://www.ecma-international.org/ecma-262/5.1 and tried to keep my > implementation as close to the specification as possible. > > The code can be found here https://github.com/fabianbergmark/ECMA-262 > > So far I have implemented the core language, but has yet to write all > the specification functions (Array.splice, String.substring etc.). > Before I do this and release it on hackage, I would appreciate > feedback on my implementation. > > The issues I see at the time are: > > * The parser is slow for deeply nested code > * Strict mode is not implemented > * Interpret.hs is ~ 6k lines > * SubType.hs uses IncoherentInstances, and a better implementation > would be nice. At the moment it works but for one case. > > To test the code, install the cabal package and run ecma262 on a .js > file. One host object, console.log is provided and prints to stdout. > > Fabian Bergmark > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tobias Dammers - tobias at twokings.nl - 070-3457628 - www.twokings.nl Maandag t/m donderdag van 9.00 tot 17.30 Voor dringende vragen, mail naar support at twokings.nl From sean at functionaljobs.com Mon Dec 8 17:00:01 2014 From: sean at functionaljobs.com (Functional Jobs) Date: Mon, 8 Dec 2014 12:00:01 -0500 Subject: [Haskell-cafe] New Functional Programming Job Opportunities Message-ID: <5485d919c7dbf@functionaljobs.com> Here are some functional programming job opportunities that were posted recently: Senior Software Engineer at McGraw-Hill Education http://functionaljobs.com/jobs/8771-senior-software-engineer-at-mcgraw-hill-education Cheers, Sean Murphy FunctionalJobs.com From silvio.frischi at gmail.com Mon Dec 8 17:47:19 2014 From: silvio.frischi at gmail.com (silvio) Date: Mon, 08 Dec 2014 18:47:19 +0100 Subject: [Haskell-cafe] Music made with Haskell In-Reply-To: References: Message-ID: <5485E427.8010805@gmail.com> > https://soundcloud.com/anton-kho/celtic > > https://soundcloud.com/anton-kho/invisible-ocean > > The music is based on samples but > a single track uses no more than 6 samples. > The code is under 100 lines of code. > I'm using my libs csound-sampler and csound-expression. I like the idea and the sound. I didn't look at the code. Is it procedural or arranged by hand? It'd be really cool to have a small haskell program that just keeps playing without end. cheers silvio From anton.kholomiov at gmail.com Mon Dec 8 17:59:19 2014 From: anton.kholomiov at gmail.com (Anton Kholomiov) Date: Mon, 8 Dec 2014 21:59:19 +0400 Subject: [Haskell-cafe] Music made with Haskell In-Reply-To: <5485E427.8010805@gmail.com> References: <5485E427.8010805@gmail.com> Message-ID: It's arranged with functions. There are functions like - play sample in the loop - play sample with some rhythmic pattern - apply reverb, pan or another effect - crossfade between samples - scale the pitch - many more You can write the functions and listen to the results. The audio output can be generated live endlessly. It can loop over and over without stop. Anton 2014-12-08 20:47 GMT+03:00 silvio : > > https://soundcloud.com/anton-kho/celtic > > > > https://soundcloud.com/anton-kho/invisible-ocean > > > > The music is based on samples but > > a single track uses no more than 6 samples. > > The code is under 100 lines of code. > > I'm using my libs csound-sampler and csound-expression. > > > I like the idea and the sound. I didn't look at the code. Is it > procedural or arranged by hand? It'd be really cool to have a small > haskell program that just keeps playing without end. > > cheers silvio > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gautier.difolco at gmail.com Mon Dec 8 22:52:29 2014 From: gautier.difolco at gmail.com (Gautier DI FOLCO) Date: Mon, 8 Dec 2014 23:52:29 +0100 Subject: [Haskell-cafe] Polykinded promoted types Message-ID: Hi all, Is there a way to get a Polykinded promoted type. For example with *Maybe* I get: data *Maybe* a = Just a | Nothing Prelude> :k *Maybe* *Maybe* :: ** -> ** Is it possible to get a *k -> **? If so, how can I do that? Thanks in advance for your help, Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t at tmh.cc Mon Dec 8 23:04:27 2014 From: t at tmh.cc (Taylor Hedberg) Date: Mon, 8 Dec 2014 15:04:27 -0800 Subject: [Haskell-cafe] Polykinded promoted types In-Reply-To: References: Message-ID: $ ghci -XDataKinds -XKindSignatures Prelude> data K = K Prelude> data Foo (a :: K) = Foo Prelude> :kind Foo Foo :: K -> * Note that types with kinds other than * are uninhabited, so you can't write a version of Maybe with that kind (because the Just constructor would require a value that can't exist). On Mon, Dec 8, 2014 at 2:52 PM, Gautier DI FOLCO wrote: > Hi all, > > Is there a way to get a Polykinded promoted type. > For example with *Maybe* I get: > data *Maybe* a = Just a | Nothing > Prelude> :k *Maybe* > *Maybe* :: ** -> ** > > Is it possible to get a *k -> **? If so, how can I do that? > > Thanks in advance for your help, > Regards. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gautier.difolco at gmail.com Mon Dec 8 23:15:46 2014 From: gautier.difolco at gmail.com (Gautier DI FOLCO) Date: Tue, 9 Dec 2014 00:15:46 +0100 Subject: [Haskell-cafe] Polykinded promoted types In-Reply-To: References: Message-ID: 2014-12-09 0:04 GMT+01:00 Taylor Hedberg : > $ ghci -XDataKinds -XKindSignatures > Prelude> data K = K > Prelude> data Foo (a :: K) = Foo > Prelude> :kind Foo > Foo :: K -> * > > Note that types with kinds other than * are uninhabited, so you can't > write a version of Maybe with that kind (because the Just constructor would > require a value that can't exist). > That was quick (and that is that I feared). Thanks anyway. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eir at cis.upenn.edu Tue Dec 9 01:35:36 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Mon, 8 Dec 2014 20:35:36 -0500 Subject: [Haskell-cafe] Polykinded promoted types In-Reply-To: References: Message-ID: <20CA13BC-A929-4EFC-BF69-C260FE2BC7FB@cis.upenn.edu> While it's true that Maybe's kind is (* -> *), there still may be a better answer to your question, which asks, "Is there a way to get a polykinded promoted type?" Maybe isn't polykinded, but it's also not promoted. With data Proxy a = P we get (Proxy :: k -> *). But that's not promoted either. On the other hand we have ('Just :: k -> Maybe k), which is promoted and polykinded, but maybe not what you want. Does this help? Richard On Dec 8, 2014, at 5:52 PM, Gautier DI FOLCO wrote: > Hi all, > > Is there a way to get a Polykinded promoted type. > For example with Maybe I get: > data Maybe a = Just a | Nothing > Prelude> :k Maybe > Maybe :: * -> * > > Is it possible to get a k -> *? If so, how can I do that? > > Thanks in advance for your help, > Regards. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.seefried at gmail.com Tue Dec 9 04:41:09 2014 From: sean.seefried at gmail.com (Sean Seefried) Date: Tue, 09 Dec 2014 04:41:09 +0000 Subject: [Haskell-cafe] External representation of GHC bytecode Message-ID: Friends, I'd like to ask a possible quite ignorant question. Can GHC produce an external representation of GHC byte code, and load that byte code back up? If it's just an internal representation is there any good reason for this? It seems to me that this would be useful for at least a few reasons: 1. This could solve the Template Haskell on cross compiler's dilemma. Currently, the problem is that a cross compiler will produce object code for the target machine which cannot be run on the host machine. But if this were bytecode the problem would be trivial to solve. 2. You could transmit Haskell programs over the network to run on arbitrary machines. 3. As it stands GHC sometimes has long standing bugs where it produces incorrect machine code on some architectures for various (fairly boring) reasons. Interpreting bytecode might be less efficient but would at least ensure that you could, in principle, run GHC on a variety of different platforms until these bugs are finally squashed. Sean -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Tue Dec 9 04:58:40 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 8 Dec 2014 23:58:40 -0500 Subject: [Haskell-cafe] External representation of GHC bytecode In-Reply-To: References: Message-ID: On Mon, Dec 8, 2014 at 11:41 PM, Sean Seefried wrote: > I'd like to ask a possible quite ignorant question. Can GHC produce an > external representation of GHC byte code, and load that byte code back up? > If it's just an internal representation is there any good reason for this? > As I understand it, the only reason is that nobody has written the necessary code. I think there may even be an open bug mouldering on the GHC Trac, looking for someone to adopt it. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From fabian.bergmark at gmail.com Tue Dec 9 06:06:29 2014 From: fabian.bergmark at gmail.com (Fabian Bergmark) Date: Tue, 9 Dec 2014 16:06:29 +1000 Subject: [Haskell-cafe] ECMA262 (Javascript) interpreter In-Reply-To: <20141208125914.GA22040@nibbler> References: <20141208125914.GA22040@nibbler> Message-ID: Yes I wrote my interpreter to support just this. In my use case the host objects execute Haskell code in a monad YQLM (StateT YQL IO) and this works fine. 2014-12-08 22:59 GMT+10:00 Tobias Dammers : > I'm kind of fiddling with solving the same (almost) problem, but since > you seem to have done most of the heavy lifting already, I'd like to > know whether your implementation could fit my needs. > > Specifically, my use case is that I want to use JavaScript as a > scripting language for a host application written in Haskell; this could > be a game, or a CMS/blogging platform, or anything else that needs > scripting; one of the must-have requirements is to parametrize the > interpreter over arbitrary monads, such that it can be sandboxed into > whatever monad stack you need to script over. > > On Sun, Dec 07, 2014 at 03:48:47PM +1000, Fabian Bergmark wrote: >> I have been implementing an ECMA-262 (Javascript) interpreter over the >> last few weeks. I have been following >> http://www.ecma-international.org/ecma-262/5.1 and tried to keep my >> implementation as close to the specification as possible. >> >> The code can be found here https://github.com/fabianbergmark/ECMA-262 >> >> So far I have implemented the core language, but has yet to write all >> the specification functions (Array.splice, String.substring etc.). >> Before I do this and release it on hackage, I would appreciate >> feedback on my implementation. >> >> The issues I see at the time are: >> >> * The parser is slow for deeply nested code >> * Strict mode is not implemented >> * Interpret.hs is ~ 6k lines >> * SubType.hs uses IncoherentInstances, and a better implementation >> would be nice. At the moment it works but for one case. >> >> To test the code, install the cabal package and run ecma262 on a .js >> file. One host object, console.log is provided and prints to stdout. >> >> Fabian Bergmark >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- > Tobias Dammers - tobias at twokings.nl - 070-3457628 - www.twokings.nl > Maandag t/m donderdag van 9.00 tot 17.30 > Voor dringende vragen, mail naar support at twokings.nl From stegeman at gmail.com Tue Dec 9 10:03:19 2014 From: stegeman at gmail.com (Luite Stegeman) Date: Tue, 9 Dec 2014 11:03:19 +0100 Subject: [Haskell-cafe] External representation of GHC bytecode In-Reply-To: References: Message-ID: On Tue, Dec 9, 2014 at 5:41 AM, Sean Seefried wrote: > > > 1. This could solve the Template Haskell on cross compiler's dilemma. Currently, the problem is that a cross compiler will produce object code for the target machine which cannot be run on the host machine. But if this were bytecode the problem would be trivial to solve. > It still wouldn't be trivial since all kinds of platform assumptions are still baked into the code, for example the word size, sizes/alignment of foreign data types, endianness and all error constants in the base library. If you compile a program with the wrong constants you get very weird error messages and problems (I've had this problem). Bytecode also doesn't support certain constructs, like unboxed tuples, so it'd need to be extended if we wanted to run a whole program from bytecode. To do it properly would involve configuring packages for two different platforms, which would either mean supporting multiple versions/targets in a single GHC and package db, or a massive overhaul of how platform specifics are handled in libraries. Either way it'd be a lot more work than compiling Template Haskell code for the target and shipping it there to run it [1]. Eventually I'd still like to see multiple targets properly supported, for example for heterogeneous cloud haskell environments, but given the changes required in the Cabal and GHC, this looks like a strictly longer term option. luite [1] https://www.haskell.org/pipermail/ghc-devs/2014-December/007555.html From sean.seefried at gmail.com Tue Dec 9 10:27:54 2014 From: sean.seefried at gmail.com (Sean Seefried) Date: Tue, 9 Dec 2014 21:27:54 +1100 Subject: [Haskell-cafe] External representation of GHC bytecode In-Reply-To: References: Message-ID: Thanks Luite, You've obviously looked into this a lot more deeply than I have. In a perfect world though, wouldn't it be good for the bytecode to be platform independent? Theoretically we know this to be possible because the JVM has been around for a long time now. If the bytecode could be made to be platform independent -- and I know this would be a *lot* of work -- then we'd have a pretty good solution for Template Haskell with cross compilers, wouldn't we? Sean On 9 December 2014 at 21:03, Luite Stegeman wrote: > On Tue, Dec 9, 2014 at 5:41 AM, Sean Seefried > wrote: > > > > > > 1. This could solve the Template Haskell on cross compiler's dilemma. > Currently, the problem is that a cross compiler will produce object code > for the target machine which cannot be run on the host machine. But if this > were bytecode the problem would be trivial to solve. > > > > It still wouldn't be trivial since all kinds of platform assumptions > are still baked into the code, for example the word size, > sizes/alignment of foreign data types, endianness and all error > constants in the base library. If you compile a program with the wrong > constants you get very weird error messages and problems (I've had > this problem). Bytecode also doesn't support certain constructs, like > unboxed tuples, so it'd need to be extended if we wanted to run a > whole program from bytecode. > > To do it properly would involve configuring packages for two different > platforms, which would either mean supporting multiple > versions/targets in a single GHC and package db, or a massive overhaul > of how platform specifics are handled in libraries. Either way it'd be > a lot more work than compiling Template Haskell code for the target > and shipping it there to run it [1]. Eventually I'd still like to see > multiple targets properly supported, for example for heterogeneous > cloud haskell environments, but given the changes required in the > Cabal and GHC, this looks like a strictly longer term option. > > luite > > [1] https://www.haskell.org/pipermail/ghc-devs/2014-December/007555.html > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gale at sefer.org Tue Dec 9 10:52:08 2014 From: gale at sefer.org (Yitzchak Gale) Date: Tue, 9 Dec 2014 12:52:08 +0200 Subject: [Haskell-cafe] Why doesn't text-icu work on 64 bit Windows? Message-ID: The text-icu library works fine with a 32 bit build of GHC on Windows. But with a 64 bit build of GHC, any use of a function from this library causes a segfault. See the issue on github for simple instructions for how to reproduce the problem: https://github.com/bos/text-icu/issues/12 As far as we know now, this could be caused by any of the following: 1. Some difference in the way ICU builds their DLLs for 64 bit Windows. 2. Some difference in the FFI bindings that is needed specifically for 64 bit Windows. 3. A problem with GHC's linking on 64 bit Windows. 4. A problem with Cabal, e.g., some option or flag that needs to be passed by default on 64 bit Windows. This is an important (and extremely high quality, thanks to Bryan O'Sullivan) library for the community, and very important for us, so I'm posting about the issue here to raise visibility. Any ideas about possible approaches to investigate or eliminate any of the above possibilities would be highly appreciated. Thanks, Yitz From allbery.b at gmail.com Tue Dec 9 11:02:45 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 9 Dec 2014 06:02:45 -0500 Subject: [Haskell-cafe] External representation of GHC bytecode In-Reply-To: References: Message-ID: On Tue, Dec 9, 2014 at 5:27 AM, Sean Seefried wrote: > If the bytecode could be made > to be platform independent -- and I know this would be a *lot* of work -- > then we'd have a pretty good solution for Template Haskell with cross > compilers, wouldn't we? > I think you're missing the point a bit; such a setup would work for runghc, but TH needs to be aware of both the host (in this case that'd be a platform-independent VM bytecode) and the target (since it is generating AST splices for a specific target). The latter is much harder than the former. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From giacomo at tesio.it Tue Dec 9 11:30:23 2014 From: giacomo at tesio.it (Giacomo Tesio) Date: Tue, 9 Dec 2014 12:30:23 +0100 Subject: [Haskell-cafe] Typed communications in (Safe) Haskell Message-ID: Hi, I'm Giacomo and I'm new to this list. I'm looking for advices to develop an haskell p2p system where the nodes comunicate over an untrusted channel (the internet). I'd like to use TLS to authenticate each node with each other. I'm wondering if exists any library/framework that already suits my needs: 1. Enable typed communications (make it easy to go from ByteString to our ADT for messages) 2. Support TLS 3. Is written in plain (possibly Safe) Haskell, because I plan to make it runnable on HaLVM/HaLNS (in the long run) 4. Acceptably easy to use since most of nodes will simply receive messages, run a simple (often pure) function on them and return a response to the caller I've seen a lot of interesting libraries on hackage (courier, daemons and more...) but AFAIK none support TLS. Any suggestion? Thanks, Giacomo -------------- next part -------------- An HTML attachment was scrubbed... URL: From kyrab at mail.ru Tue Dec 9 11:58:53 2014 From: kyrab at mail.ru (kyra) Date: Tue, 09 Dec 2014 14:58:53 +0300 Subject: [Haskell-cafe] Why doesn't text-icu work on 64 bit Windows? In-Reply-To: References: Message-ID: <5486E3FD.9000008@mail.ru> Didn't look into details, so a couple of general advises: 1. On 64-bit platforms gcc and GHC silently link against Visual C-created import libraries, but resulting exe segfaults. Import libraries should be recreated with native 64-bit dlltool. 2. Perhaps the most important difference between 64-bit Windows and Linux ABIs is that "long" is 4-byte on Windows. Cheers, Kyra On 09-Dec-14 13:52, Yitzchak Gale wrote: > The text-icu library works fine with a 32 bit build of GHC on > Windows. But with a 64 bit build of GHC, any use of a function > from this library causes a segfault. See the issue on github for > simple instructions for how to reproduce the problem: > > https://github.com/bos/text-icu/issues/12 > > As far as we know now, this could be caused by any of the following: > > 1. Some difference in the way ICU builds their DLLs for 64 bit Windows. > > 2. Some difference in the FFI bindings that is needed specifically > for 64 bit Windows. > > 3. A problem with GHC's linking on 64 bit Windows. > > 4. A problem with Cabal, e.g., some option or flag that needs to be > passed by default on 64 bit Windows. > > This is an important (and extremely high quality, thanks to > Bryan O'Sullivan) library for the community, and very important for us, > so I'm posting about the issue here to raise visibility. > Any ideas about possible approaches to investigate or eliminate any > of the above possibilities would be highly appreciated. > > Thanks, > Yitz > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From sean.seefried at gmail.com Tue Dec 9 12:21:35 2014 From: sean.seefried at gmail.com (Sean Seefried) Date: Tue, 9 Dec 2014 23:21:35 +1100 Subject: [Haskell-cafe] External representation of GHC bytecode In-Reply-To: References: Message-ID: If what you say is true then I think I have some holes in my understanding of TH. Aren't AST splices, by definition, just generated Haskell source code? Isn't the whole idea that TH produces source code as if a programmer wrote it in the first place? How is this platform dependent? My understanding of Template Haskell was that something like the following happened: 1. Code generating functions in a module (call it module M) are compiled to an object file. 2. A modules, call it P, that wishes generate code imports module M and runs this code at compile time. But as far as I can tell this only generates *source code*. P then needs to be compiled to object code. The problem in the cross compiler situation is that the dynamic linker can't load the code in M.o since that has been compiled for the target machine, not the host. Apart from that though, I don't see what is platform specific about the code *generated* in module P by the functions imported from module M. It's just source code isn't it? Not object code. Sean On 9 December 2014 at 22:02, Brandon Allbery wrote: > On Tue, Dec 9, 2014 at 5:27 AM, Sean Seefried > wrote: > >> If the bytecode could be made >> to be platform independent -- and I know this would be a *lot* of work -- >> then we'd have a pretty good solution for Template Haskell with cross >> compilers, wouldn't we? >> > > I think you're missing the point a bit; such a setup would work for > runghc, but TH needs to be aware of both the host (in this case that'd be a > platform-independent VM bytecode) and the target (since it is generating > AST splices for a specific target). The latter is much harder than the > former. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Tue Dec 9 12:48:17 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 9 Dec 2014 12:48:17 +0000 Subject: [Haskell-cafe] Cabal 1.8 ignores bounds in test-suite sections? Message-ID: <20141209124817.GJ29989@weber> I have a cabal file with two test suites https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/opaleye.cabal If I change the dependency in "test-suite tutorial", say, from `profunctors` to `profunctors >= 0.6` then the bound is completely ignored and cabal will attempt to compile and run the test suite even without a suitable version present. Is this expected behaviour? Tom From michael at snoyman.com Tue Dec 9 12:50:59 2014 From: michael at snoyman.com (Michael Snoyman) Date: Tue, 09 Dec 2014 12:50:59 +0000 Subject: [Haskell-cafe] Cabal 1.8 ignores bounds in test-suite sections? References: <20141209124817.GJ29989@weber> Message-ID: Do you mean "1.18" instead of "1.8"? On Tue Dec 09 2014 at 2:48:29 PM Tom Ellis < tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote: > I have a cabal file with two test suites > > https://github.com/tomjaguarpaw/haskell-opaleye/ > blob/master/opaleye.cabal > > If I change the dependency in "test-suite tutorial", say, from > `profunctors` > to `profunctors >= 0.6` then the bound is completely ignored and cabal will > attempt to compile and run the test suite even without a suitable version > present. > > Is this expected behaviour? > > Tom > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Tue Dec 9 12:57:30 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 9 Dec 2014 12:57:30 +0000 Subject: [Haskell-cafe] Cabal ignores bounds in test-suite sections? In-Reply-To: References: <20141209124817.GJ29989@weber> Message-ID: <20141209125730.GK29989@weber> Sorry, that was misleading. What I meant was "when specifying 'cabal-version: >= 1.8' in the cabal file", but still the same happens if I specify 'cabal-version >= 1.18'. On Tue, Dec 09, 2014 at 12:50:59PM +0000, Michael Snoyman wrote: > Do you mean "1.18" instead of "1.8"? > > On Tue Dec 09 2014 at 2:48:29 PM Tom Ellis < > tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote: > > > I have a cabal file with two test suites > > > > https://github.com/tomjaguarpaw/haskell-opaleye/ > > blob/master/opaleye.cabal > > > > If I change the dependency in "test-suite tutorial", say, from > > `profunctors` > > to `profunctors >= 0.6` then the bound is completely ignored and cabal will > > attempt to compile and run the test suite even without a suitable version > > present. > > > > Is this expected behaviour? > > > > Tom > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Tue Dec 9 13:09:37 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 9 Dec 2014 13:09:37 +0000 Subject: [Haskell-cafe] Cabal 1.8 ignores bounds in test-suite sections? In-Reply-To: <20141209124817.GJ29989@weber> References: <20141209124817.GJ29989@weber> Message-ID: <20141209130937.GL29989@weber> On Tue, Dec 09, 2014 at 12:48:17PM +0000, Tom Ellis wrote: > I have a cabal file with two test suites > > https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/opaleye.cabal > > If I change the dependency in "test-suite tutorial", say, from `profunctors` > to `profunctors >= 0.6` then the bound is completely ignored and cabal will > attempt to compile and run the test suite even without a suitable version > present. For precision I should say I meant `product-profunctors >= 0.6`. But in any case the exact example irrelevant since it doesn't matter if I specify `product-profunctors >= 100` or `base >= 1000000` in a test-suite section. It's ignored. From neto at netowork.me Tue Dec 9 13:34:36 2014 From: neto at netowork.me (Ernesto Rodriguez) Date: Tue, 9 Dec 2014 14:34:36 +0100 Subject: [Haskell-cafe] Typed communications in (Safe) Haskell In-Reply-To: References: Message-ID: Hi Giacomo, For your problem, Cloud Haskell is probably the state of the art. I haven't used it for a while so I can't tell u how well TLS is supported. Otherwise, you should consider asking in the parallel-haskell < parallel-haskell at googlegroups.com> and distributed-haskell at googlegroups.com lists. Cheers, On Tue, Dec 9, 2014 at 12:30 PM, Giacomo Tesio wrote: > Hi, I'm Giacomo and I'm new to this list. > > I'm looking for advices to develop an haskell p2p system where the nodes > comunicate over an untrusted channel (the internet). I'd like to use TLS to > authenticate each node with each other. > > I'm wondering if exists any library/framework that already suits my needs: > > 1. Enable typed communications (make it easy to go from ByteString to > our ADT for messages) > 2. Support TLS > 3. Is written in plain (possibly Safe) Haskell, because I plan to make > it runnable on HaLVM/HaLNS (in the long run) > 4. Acceptably easy to use since most of nodes will simply receive > messages, run a simple (often pure) function on them and return a response > to the caller > > I've seen a lot of interesting libraries on hackage (courier, daemons and > more...) but AFAIK none support TLS. > > Any suggestion? > > > Thanks, > > Giacomo > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Ernesto Rodriguez Masters Student Computer Science Utrecht University www.netowork.me github.com/netogallo -------------- next part -------------- An HTML attachment was scrubbed... URL: From alpmestan at gmail.com Tue Dec 9 15:05:19 2014 From: alpmestan at gmail.com (Alp Mestanogullari) Date: Tue, 9 Dec 2014 16:05:19 +0100 Subject: [Haskell-cafe] [ANN] servant 0.2 - trying to rethink webservices and APIs Message-ID: Hello -cafe, These past few weeks, with S?nke Hahn and Julian Arni, we've been working on a complete rewrite of servant, a library whose aim is to assist as much as possible in writing webservices. We came up with a (type-level) "API combinator" based design, that lets us declare webservice APIs, implement handlers that serve those APIs, derive client functions in Haskell and Javascript to query those endpoints and generate documentation. This is all very composable, you can write your own combinators or write your own interpretation of an API's type, or just use the "standard" ones already provided by the core library. Here's an announcement post with an example: http://alpmestan.com/posts/2014-12-09-rethinking-webservices-apis-haskell.html Getting started guide: http://haskell-servant.github.io/getting-started/ The reddit discussion (in case you prefer reddit to here for such discussions): http://www.reddit.com/r/haskell/comments/2orb8t/rethinking_webservice_and_apis_in_haskell_servant/ All 4 libraries are installable with a simple 'cabal install', have a decent amount of documentation and accompanying examples. We would be glad to hear any kind of feedback or ideas -- we're already deploying servant webservices in our respective companies so it suits our use cases, but we would gladly discuss new combinators and what not. -- Alp Mestanogullari -------------- next part -------------- An HTML attachment was scrubbed... URL: From gale at sefer.org Tue Dec 9 17:18:14 2014 From: gale at sefer.org (Yitzchak Gale) Date: Tue, 9 Dec 2014 19:18:14 +0200 Subject: [Haskell-cafe] Why doesn't text-icu work on 64 bit Windows? In-Reply-To: <5486E3FD.9000008@mail.ru> References: <5486E3FD.9000008@mail.ru> Message-ID: I wrote: >> 1. Some difference in the way ICU builds their DLLs for 64 bit Windows. kyra wrote: > 1. On 64-bit platforms gcc and GHC silently link against Visual C-created > import libraries, but resulting exe segfaults. Import libraries should be > recreated with native 64-bit dlltool. Hmm, that would be a pretty complex task, but maybe I'll try it. The question is - if this is the problem, then why do the DLLs generated by Visual Studio work for 32 bits but not 64 bits? I found instructions how to do it here: http://www.willus.com/mingw/colinp/win32/dll/make.html Summary: Create a .def file with this format: EXPORTS Foo Bar where Foo and Bar are the symbols to be exported by the DLL. Then run these commands: gcc -mdll -o junk.tmp -Wl,--base-file,base.tmp bar.o del junk.tmp dlltool --dllname bar.dll --base-file base.tmp --output-exp temp.exp --def bar.def del base.tmp gcc -mdll -o bar.dll bar.o -Wl,temp.exp del temp.exp The first few steps use the .def file to create an .exp file. ICU provides the Visual Studio 2010 .exp files, so I tried just using those. It didn't work. So in order to figure out what symbols to export for each DLL, It looks like I'll need to open the ICU4C projects in Visual Studio 2010. Is this really what you need to go through to compile a basic library from Hackage on 64 bit Windows? >> 2. Some difference in the FFI bindings that is needed specifically >> for 64 bit Windows. > 2. Perhaps the most important difference between 64-bit Windows and Linux > ABIs is that "long" is 4-byte on Windows. The long C type doesn't seem to be mentioned (at least directly) anywhere in the FFI bindings. Thanks, Yitz From adam at bergmark.nl Tue Dec 9 17:30:41 2014 From: adam at bergmark.nl (Adam Bergmark) Date: Tue, 9 Dec 2014 18:30:41 +0100 Subject: [Haskell-cafe] Cabal 1.8 ignores bounds in test-suite sections? In-Reply-To: <20141209130937.GL29989@weber> References: <20141209124817.GJ29989@weber> <20141209130937.GL29989@weber> Message-ID: I find this unintuitive. Are you configuring with `--enable-tests`? On Tue, Dec 9, 2014 at 2:09 PM, Tom Ellis < tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote: > On Tue, Dec 09, 2014 at 12:48:17PM +0000, Tom Ellis wrote: > > I have a cabal file with two test suites > > > > > https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/opaleye.cabal > > > > If I change the dependency in "test-suite tutorial", say, from > `profunctors` > > to `profunctors >= 0.6` then the bound is completely ignored and cabal > will > > attempt to compile and run the test suite even without a suitable version > > present. > > For precision I should say I meant `product-profunctors >= 0.6`. > > But in any case the exact example irrelevant since it doesn't matter if I > specify `product-profunctors >= 100` or `base >= 1000000` in a test-suite > section. It's ignored. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Tue Dec 9 18:02:54 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 9 Dec 2014 18:02:54 +0000 Subject: [Haskell-cafe] Cabal 1.8 ignores bounds in test-suite sections? In-Reply-To: References: <20141209124817.GJ29989@weber> <20141209130937.GL29989@weber> Message-ID: <20141209180253.GS29989@weber> Ah, thank you, that does the trick. So the situation is that you can 1. `cabal configure --enable-tests` 2. change the `test-suite` section 3. still run `cabal test`, and it just uses the old settings This does indeed give me the warning ./opaleye.cabal has been changed. Re-configuring with most recently used options. If this fails, please run configure manually but I still find the behaviour a bit odd. Anyway, I now understand what is going on! Tom On Tue, Dec 09, 2014 at 06:30:41PM +0100, Adam Bergmark wrote: > I find this unintuitive. Are you configuring with `--enable-tests`? > > > > On Tue, Dec 9, 2014 at 2:09 PM, Tom Ellis < > tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote: > > > On Tue, Dec 09, 2014 at 12:48:17PM +0000, Tom Ellis wrote: > > > I have a cabal file with two test suites > > > > > > > > https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/opaleye.cabal > > > > > > If I change the dependency in "test-suite tutorial", say, from > > `profunctors` > > > to `profunctors >= 0.6` then the bound is completely ignored and cabal > > will > > > attempt to compile and run the test suite even without a suitable version > > > present. > > > > For precision I should say I meant `product-profunctors >= 0.6`. > > > > But in any case the exact example irrelevant since it doesn't matter if I > > specify `product-profunctors >= 100` or `base >= 1000000` in a test-suite > > section. It's ignored. From kyrab at mail.ru Tue Dec 9 20:06:02 2014 From: kyrab at mail.ru (kyra) Date: Tue, 09 Dec 2014 23:06:02 +0300 Subject: [Haskell-cafe] Why doesn't text-icu work on 64 bit Windows? In-Reply-To: References: <5486E3FD.9000008@mail.ru> Message-ID: <5487562A.1050309@mail.ru> On 09-Dec-14 20:18, Yitzchak Gale wrote: > Hmm, that would be a pretty complex task, but maybe I'll try it. > The question is - if this is the problem, then why do the DLLs > generated by Visual Studio work for 32 bits but not 64 bits? I don't know why but this is so. > I found instructions how to do it here: > > http://www.willus.com/mingw/colinp/win32/dll/make.html > > Summary: > > Create a .def file with this format: > > EXPORTS > Foo > Bar > > where Foo and Bar are the symbols to be exported by the DLL. > > Then run these commands: > > gcc -mdll -o junk.tmp -Wl,--base-file,base.tmp bar.o > del junk.tmp > dlltool --dllname bar.dll --base-file base.tmp --output-exp temp.exp > --def bar.def > del base.tmp > gcc -mdll -o bar.dll bar.o -Wl,temp.exp > del temp.exp > > The first few steps use the .def file to create an .exp file. > ICU provides the Visual Studio 2010 .exp files, so I tried > just using those. It didn't work. So in order to figure out what > symbols to export for each DLL, It looks like I'll need to open > the ICU4C projects in Visual Studio 2010. > > Is this really what you need to go through to compile a basic > library from Hackage on 64 bit Windows? No, no. If you have existing .def file the single thing to do is 'dlltool -l -D -d <.def filename>'. The problem is how to obtain .def file from existing dll. There exists 'pexports' utility generating .def file from given dll, but I'm not sure it exists for 64-bit case. There are 2 possibilities though: 1. Use Microsoft 'dumpbin' utility, which gives a list of exported symbols when run with '/EXPORTS' flag. The utility should be available from VS community edition at least. 2. Try to link to DLLs *directly* -- using binutils' facility to link against DLL directly instead of it's import lib. Cheers, Kyra From gautier.difolco at gmail.com Tue Dec 9 23:09:40 2014 From: gautier.difolco at gmail.com (Gautier DI FOLCO) Date: Wed, 10 Dec 2014 00:09:40 +0100 Subject: [Haskell-cafe] Polykinded promoted types In-Reply-To: <20CA13BC-A929-4EFC-BF69-C260FE2BC7FB@cis.upenn.edu> References: <20CA13BC-A929-4EFC-BF69-C260FE2BC7FB@cis.upenn.edu> Message-ID: 2014-12-09 2:35 GMT+01:00 Richard Eisenberg : > While it's true that Maybe's kind is (* -> *), there still may be a better > answer to your question, which asks, "Is there a way to get a polykinded > promoted type?" Maybe isn't polykinded, but it's also not promoted. With > > data Proxy a = P > > we get (Proxy :: k -> *). But that's not promoted either. On the other > hand we have ('Just :: k -> Maybe k), which is promoted and polykinded, but > maybe not what you want. > > Does this help? > Hello, In fact my problem occurs when I try to describe (Iso)morphisms: type Cons1 (e :: k1) (n :: k2) = Product e n type Nil1 = Void type Cons2 e n = Just (Product e n) type Nil2 = Nothing data List3 a = Nil3 | Cons3 a (List3 a) type family List1_List2 a where List1_List2 (Cons1 a b) = Cons2 a (List1_List2 b) List1_List2 Nil1 = Nil2 type family List2_List1 a where List2_List1 (Cons2 a b) = Cons1 a (List2_List1 b) List2_List1 Nil2 = Nil1 type family List2_List3 a where List2_List3 (Cons2 a b) = Cons3 a (List2_List3 b) List2_List3 Nil2 = Nil3 type family List3_List2 a where List3_List2 (Cons3 a b) = Cons2 a (List3_List2 b) List3_List2 Nil3 = Nil2 type List1_List3 a = List2_List3 (List1_List2 a) type List3_List1 a = List2_List1 (List3_List2 a) There is an Isomorphism between List1 and List2 (List1_List2 (List2_List1 a) == a and List2_List1 (List1_List2 a) == a) but not between List3 and the others due to it's * kind. Thanks, Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wojtek at power.com.pl Tue Dec 9 23:18:04 2014 From: wojtek at power.com.pl (=?UTF-8?B?V29qdGVrIE5hcmN6ecWEc2tp?=) Date: Wed, 10 Dec 2014 00:18:04 +0100 Subject: [Haskell-cafe] [ANN] servant 0.2 - trying to rethink webservices and APIs In-Reply-To: References: Message-ID: <5487832C.4010203@power.com.pl> Hello, Interesting, thank you! Can your library handle optional parameters? I guess, not right now but can be done, right? At first glance I thought the :> operator had something to do with subtyping.How about defining the operators somehow like this: type UserAPI = "users" "search" QueryParam "q" Text <,> QueryParam "n" Word64 ::: Get [User] In addition to more visual resemblance to http, you could probably enforce more type safety this way, too. -- Kind regards, Wojtek Narczynski From alpmestan at gmail.com Wed Dec 10 07:29:25 2014 From: alpmestan at gmail.com (Alp Mestanogullari) Date: Wed, 10 Dec 2014 08:29:25 +0100 Subject: [Haskell-cafe] [ANN] servant 0.2 - trying to rethink webservices and APIs In-Reply-To: <5487832C.4010203@power.com.pl> References: <5487832C.4010203@power.com.pl> Message-ID: Hello, Querystring parameters are optional. The corresponding handler argument is automatically a Maybe, because one can reach this endpoint while not specifying a value for that param. I understand the operator naming scheme can be a bit odd when you're not used to it, we'll see what suits people the most after we get more feedback on that :) Le 10 d?c. 2014 00:18, "Wojtek Narczy?ski" a ?crit : > Hello, > > Interesting, thank you! > > Can your library handle optional parameters? I guess, not right now but > can be done, right? > > At first glance I thought the :> operator had something to do with > subtyping.How about defining the operators somehow like this: > > type UserAPI = "users" "search" QueryParam "q" Text <,> QueryParam > "n" Word64 ::: Get [User] > > In addition to more visual resemblance to http, you could probably enforce > more type safety this way, too. > > > -- > Kind regards, > Wojtek Narczynski > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gale at sefer.org Wed Dec 10 12:56:20 2014 From: gale at sefer.org (Yitzchak Gale) Date: Wed, 10 Dec 2014 14:56:20 +0200 Subject: [Haskell-cafe] Why doesn't text-icu work on 64 bit Windows? In-Reply-To: <5487562A.1050309@mail.ru> References: <5486E3FD.9000008@mail.ru> <5487562A.1050309@mail.ru> Message-ID: I wrote: >> I found instructions how to do it here: >> http://www.willus.com/mingw/colinp/win32/dll/make.html Kyra wrote: > No, no. If you have existing .def file the single thing to do is 'dlltool -l > -D -d <.def filename>'. I tried that - there was no output. Note that in dlltool --help it says that -D is for *input* DLL file. > The problem is how to obtain .def file from existing dll? > 1. Use Microsoft 'dumpbin' utility, which gives a list of exported symbols > when run with '/EXPORTS' flag. The utility should be available from VS > community edition at least. I have full VS 10, so I have dumpbin. But the exports list it creates has many C++ mangled symbols, like: ??0?$EnumSet at W4UDateFormatBooleanAttribute@@$0A@$03 at icu_54@@QEAA at AEBV01@@Z When I try to create a .exp using dlltool with a .def containing junk like that, it fails: dqsfc.s: Assembler messages: dqsfc.s:4102: Error: bad expression dqsfc.s:4102: Fatal error: rva without symbol dlltool: as exited with status 1 > 2. Try to link to DLLs *directly* -- using binutils' facility to link > against DLL directly instead of it's import lib. That would be much better. If we can get that to work, we can teach cabal how to do it too. Then FFI will work again on Windows 64 bits. The problem is that binutils does not understand DLLs from VS on 64 bits, it seems. Thanks, Yitz From kyrab at mail.ru Wed Dec 10 14:12:50 2014 From: kyrab at mail.ru (kyra) Date: Wed, 10 Dec 2014 17:12:50 +0300 Subject: [Haskell-cafe] Why doesn't text-icu work on 64 bit Windows? In-Reply-To: References: <5486E3FD.9000008@mail.ru> <5487562A.1050309@mail.ru> Message-ID: <548854E2.2010208@mail.ru> On 10-Dec-14 15:56, Yitzchak Gale wrote: >> No, no. If you have existing .def file the single thing to do is 'dlltool -l >> -D -d <.def filename>'. > I tried that - there was no output. > Note that in dlltool --help it says that -D is for *input* DLL file. I did this multiple times with success :) I think there is something wrong with your .def file, perhaps. In this use case dlltool needs *no* DLL itself -- only its name. For some reasons dlltool ignores a clause of 'LIBRARY' statement in .def file and uses whatever name you supply to -D option. For example, to generate import library for icuin52.dll you can use the following command-line: dlltool -l libicudt.a -D icuin52.dll -d icuin52.def where icuin52.def is the single input *file*, others arguments are parameters only, you need no have physically present icuin52.dll at all. >> The problem is how to obtain .def file from existing dll? >> 1. Use Microsoft 'dumpbin' utility, which gives a list of exported symbols >> when run with '/EXPORTS' flag. The utility should be available from VS >> community edition at least. > I have full VS 10, so I have dumpbin. But the exports list it > creates has many C++ mangled symbols, like: > > ??0?$EnumSet at W4UDateFormatBooleanAttribute@@$0A@$03 at icu_54@@QEAA at AEBV01@@Z > > When I try to create a .exp using dlltool with a .def containing > junk like that, it fails: > > dqsfc.s: Assembler messages: > dqsfc.s:4102: Error: bad expression > dqsfc.s:4102: Fatal error: rva without symbol > dlltool: as exited with status 1 These are mangled Visual C++ names, you can't use them at all and you don't need them at all, you should simply remove all of them from your .def file. >> 2. Try to link to DLLs *directly* -- using binutils' facility to link >> against DLL directly instead of it's import lib. > That would be much better. If we can get that to work, > we can teach cabal how to do it too. Then FFI will work > again on Windows 64 bits. The problem is that binutils > does not understand DLLs from VS on 64 bits, it seems. I successfully used several Windows 64 Visual C++- generated DLLs through FFI. Usually there are no problems with them if your generate import libraries as described above. Cheers, Kyra From gale at sefer.org Wed Dec 10 14:57:47 2014 From: gale at sefer.org (Yitzchak Gale) Date: Wed, 10 Dec 2014 16:57:47 +0200 Subject: [Haskell-cafe] Why doesn't text-icu work on 64 bit Windows? In-Reply-To: <548854E2.2010208@mail.ru> References: <5486E3FD.9000008@mail.ru> <5487562A.1050309@mail.ru> <548854E2.2010208@mail.ru> Message-ID: Kyra wrote: >>> No, no. If you have existing .def file the single thing to do is >>> 'dlltool -l -D -d <.def filename>'. I wrote: >> I tried that - there was no output. >> Note that in dlltool --help it says that -D is for *input* DLL file. > I did this multiple times with success :) I think there is something wrong > with your .def file, perhaps. Yes that makes sense. My .def file has only this: EXPORTS symbol1 symbol2 ? What does a correct .def file look like? > These are mangled Visual C++ names, you can't use them > at all and you don't need them at all, you should simply > remove all of them from your .def file. OK I did that. Now I was able to use dlltool to create new .lib files from the original DLLs. And I was able to compile my test program against the new .lib files. But it still segfaults when I try to run it with the original DLLs. > I successfully used several Windows 64 Visual C++- > generated DLLs through FFI. Usually there are no > problems with them if your generate import > libraries as described above. That is great! Can you get a successful build of my simple test code: https://github.com/ygale/test-text-icu and give a list of exactly what commands you entered to get it to build? (Check that the compiled executable runs without segfault.) That would be very helpful. Thanks, Yitz From eir at cis.upenn.edu Wed Dec 10 15:21:35 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Wed, 10 Dec 2014 10:21:35 -0500 Subject: [Haskell-cafe] Polykinded promoted types In-Reply-To: References: <20CA13BC-A929-4EFC-BF69-C260FE2BC7FB@cis.upenn.edu> Message-ID: <52398347-EA1A-406E-922C-4A81569291CE@cis.upenn.edu> The problem I see here is that your List1 and List2 kinds are essentially untyped. These lists are allowed to store any types. For example, I can say `Cons1 'True (Cons1 Int Nil1)`, even though 'True and Int have different kinds. Your List3 won't allow such a construction. You're right that the kinds aren't isomorphic. Does this help? Richard On Dec 9, 2014, at 6:09 PM, Gautier DI FOLCO wrote: > Hello, > > In fact my problem occurs when I try to describe (Iso)morphisms: > type Cons1 (e :: k1) (n :: k2) = Product e n > type Nil1 = Void > > type Cons2 e n = Just (Product e n) > type Nil2 = Nothing > > data List3 a = Nil3 | Cons3 a (List3 a) > > type family List1_List2 a where > List1_List2 (Cons1 a b) = Cons2 a (List1_List2 b) > List1_List2 Nil1 = Nil2 > > type family List2_List1 a where > List2_List1 (Cons2 a b) = Cons1 a (List2_List1 b) > List2_List1 Nil2 = Nil1 > > type family List2_List3 a where > List2_List3 (Cons2 a b) = Cons3 a (List2_List3 b) > List2_List3 Nil2 = Nil3 > > type family List3_List2 a where > List3_List2 (Cons3 a b) = Cons2 a (List3_List2 b) > List3_List2 Nil3 = Nil2 > > type List1_List3 a = List2_List3 (List1_List2 a) > type List3_List1 a = List2_List1 (List3_List2 a) > > There is an Isomorphism between List1 and List2 (List1_List2 (List2_List1 a) == a and List2_List1 (List1_List2 a) == a) but not between List3 and the others due to it's * kind. > > Thanks, > Regards. From gautier.difolco at gmail.com Wed Dec 10 17:31:29 2014 From: gautier.difolco at gmail.com (Gautier DI FOLCO) Date: Wed, 10 Dec 2014 18:31:29 +0100 Subject: [Haskell-cafe] Polykinded promoted types In-Reply-To: <52398347-EA1A-406E-922C-4A81569291CE@cis.upenn.edu> References: <20CA13BC-A929-4EFC-BF69-C260FE2BC7FB@cis.upenn.edu> <52398347-EA1A-406E-922C-4A81569291CE@cis.upenn.edu> Message-ID: 2014-12-10 16:21 GMT+01:00 Richard Eisenberg : > The problem I see here is that your List1 and List2 kinds are essentially > untyped. These lists are allowed to store any types. For example, I can say > `Cons1 'True (Cons1 Int Nil1)`, even though 'True and Int have different > kinds. Your List3 won't allow such a construction. You're right that the > kinds aren't isomorphic. > > Does this help? > Yes, it does. I guess that there is no way to escape ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Wed Dec 10 19:09:42 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 10 Dec 2014 19:09:42 +0000 Subject: [Haskell-cafe] Cabal builds file at top level incorrectly Message-ID: <20141210190942.GA29989@weber> Cabal's behaviour is strange to me. My example cabal file is as follows: name: break version: 0.1 cabal-version: >= 1.2 build-type: Simple library hs-source-dirs: src build-depends: base >= 4 && < 5 exposed-modules: Break and I have a module `src/Break.hs` that I want it to compile. That would work fine. But if I have another file at the top-level caled `Break.hs` it compiles that one instead. It also seems to want it to be an executable. What's going on? Full reproduction below. You can see it is trying to compile `Break.hs` not `src/Break.hs`. % git clone https://github.com/tomjaguarpaw/break.git Cloning into 'break'... [...] % cd break % cabal configure && cabal test Resolving dependencies... Configuring break-0.1... Re-configuring with test suites enabled. If this fails, please run configure manually. Resolving dependencies... Configuring break-0.1... Building break-0.1... Preprocessing library break-0.1... [1 of 1] Compiling Main ( Break.hs, dist/build/Main.o ) Break.hs:1:1: The function `main' is not defined in module `main:Main' From roma at ro-che.info Wed Dec 10 20:08:16 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Wed, 10 Dec 2014 22:08:16 +0200 Subject: [Haskell-cafe] Cabal builds file at top level incorrectly In-Reply-To: <20141210190942.GA29989@weber> References: <20141210190942.GA29989@weber> Message-ID: <5488A830.3070408@ro-che.info> This appears to be a bug in ghc, not cabal. Cabal correctly calls ghc with -i, which should empty the search path. Apparently, that -i is ignored. Please report this to ghc trac. (Feel free to copy this email as an explanation.) Roman On 10/12/14 21:09, Tom Ellis wrote: > Cabal's behaviour is strange to me. My example cabal file is as follows: > > name: break > version: 0.1 > cabal-version: >= 1.2 > build-type: Simple > > library > hs-source-dirs: src > build-depends: > base >= 4 && < 5 > exposed-modules: Break > > and I have a module `src/Break.hs` that I want it to compile. That would > work fine. But if I have another file at the top-level caled `Break.hs` it > compiles that one instead. It also seems to want it to be an executable. > > What's going on? > > Full reproduction below. You can see it is trying to compile `Break.hs` not > `src/Break.hs`. > > > % git clone https://github.com/tomjaguarpaw/break.git > Cloning into 'break'... > [...] > % cd break > % cabal configure && cabal test > Resolving dependencies... > Configuring break-0.1... > Re-configuring with test suites enabled. If this fails, please run configure > manually. > Resolving dependencies... > Configuring break-0.1... > Building break-0.1... > Preprocessing library break-0.1... > [1 of 1] Compiling Main ( Break.hs, dist/build/Main.o ) > > Break.hs:1:1: > The function `main' is not defined in module `main:Main' > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From eir at cis.upenn.edu Wed Dec 10 20:32:45 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Wed, 10 Dec 2014 15:32:45 -0500 Subject: [Haskell-cafe] Polykinded promoted types In-Reply-To: References: <20CA13BC-A929-4EFC-BF69-C260FE2BC7FB@cis.upenn.edu> <52398347-EA1A-406E-922C-4A81569291CE@cis.upenn.edu> Message-ID: On Dec 10, 2014, at 12:31 PM, Gautier DI FOLCO wrote: > 2014-12-10 16:21 GMT+01:00 Richard Eisenberg : > The problem I see here is that your List1 and List2 kinds are essentially untyped. These lists are allowed to store any types. For example, I can say `Cons1 'True (Cons1 Int Nil1)`, even though 'True and Int have different kinds. Your List3 won't allow such a construction. You're right that the kinds aren't isomorphic. > > Does this help? > > Yes, it does. > I guess that there is no way to escape ? Escape what, exactly? I'm not sure what your end goal is, so I don't know what you're trying to escape from. Is this what you want? > data List where > Nil :: List > Cons :: a -> b -> List > > type Foo = Cons True (Cons "x" (Cons () Nil)) That works, but isn't very useful in practice, I don't think... Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From gautier.difolco at gmail.com Wed Dec 10 22:37:22 2014 From: gautier.difolco at gmail.com (Gautier DI FOLCO) Date: Wed, 10 Dec 2014 23:37:22 +0100 Subject: [Haskell-cafe] Polykinded promoted types In-Reply-To: References: <20CA13BC-A929-4EFC-BF69-C260FE2BC7FB@cis.upenn.edu> <52398347-EA1A-406E-922C-4A81569291CE@cis.upenn.edu> Message-ID: 2014-12-10 21:32 GMT+01:00 Richard Eisenberg : > Escape what, exactly? I'm not sure what your end goal is, so I don't know > what you're trying to escape from. > > Is this what you want? > > data List where > Nil :: List > Cons :: a -> b -> List > > type Foo = Cons True (Cons "x" (Cons () Nil)) > > > That works, but isn't very useful in practice, I don't think... > Escape from this trouble. When I try to apply a type family on it, I get a forall k, isn't there a way to "set" it? Thanks, Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstcruz at gmail.com Thu Dec 11 04:50:02 2014 From: dstcruz at gmail.com (Daniel Santa Cruz) Date: Wed, 10 Dec 2014 21:50:02 -0700 Subject: [Haskell-cafe] Haskell Weekly News: Issue 313 Message-ID: Welcome to issue 313 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers from November 16 to December 6, 2014 Quotes of the Week * Dijkstra: How do we convince people that in programming simplicity and clarity (in short: what mathematicians call "elegance") are not a dispensable luxury, but a crucial matter that decides between success and failure? * Dijkstra: Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better. * monochrom: those who have learned from history are bound to helplessly watch other people repeat it. Top Reddit Stories * 24 Days of GHC Extensions: Welcome! Domain: ocharles.org.uk, Score: 140, Comments: 24 Original: [1] http://goo.gl/HvjuvJ On Reddit: [2] http://goo.gl/4Skf5Z * How I Start: Haskell Domain: howistart.org, Score: 120, Comments: 11 Original: [3] http://goo.gl/T2OCwj On Reddit: [4] http://goo.gl/1bGl7I * Lucid: templating DSL for HTML Domain: chrisdone.com, Score: 105, Comments: 59 Original: [5] http://goo.gl/JJsJlT On Reddit: [6] http://goo.gl/jyvkHu * Erik Meijer planning to make Category theory for programmers MOOC Domain: imgur.com, Score: 105, Comments: 45 Original: [7] http://goo.gl/ZnCi6Z On Reddit: [8] http://goo.gl/8vOFP0 * An opportunity in Singapore Domain: self.haskell, Score: 98, Comments: 31 Original: [9] http://goo.gl/X0OBAE On Reddit: [10] http://goo.gl/X0OBAE * Dan Piponi working on an audio synthesis tool written in Haskell Domain: plus.google.com, Score: 90, Comments: 1 Original: [11] http://goo.gl/J83NRS On Reddit: [12] http://goo.gl/Cbhx8x * GHC and LLVM: The State of the Union Domain: smart-cactus.org, Score: 86, Comments: 13 Original: [13] http://goo.gl/CA7R4C On Reddit: [14] http://goo.gl/l3L8H7 * Learning Haskell as a Nonprogrammer Domain: superginbaby.wordpress.com, Score: 84, Comments: 77 Original: [15] http://goo.gl/9Q1ufS On Reddit: [16] http://goo.gl/Yqni7Y * Announcing Opaleye: SQL-generating embedded domain specific language for Postgres Domain: self.haskell, Score: 84, Comments: 85 Original: [17] http://goo.gl/HoMXjj On Reddit: [18] http://goo.gl/HoMXjj * Deploy any Haskell application. Instantly. Domain: halcyon.sh, Score: 79, Comments: 27 Original: [19] http://goo.gl/sxQWKk On Reddit: [20] http://goo.gl/5V2dMj * Haskell for all: How to build library-agnostic streaming sources Domain: haskellforall.com, Score: 75, Comments: 26 Original: [21] http://goo.gl/1QcyRf On Reddit: [22] http://goo.gl/eYwlBp * Image Processing with Comonads Domain: jaspervdj.be, Score: 74, Comments: 33 Original: [23] http://goo.gl/GZu2oc On Reddit: [24] http://goo.gl/Xsh0z9 * 24 Days of GHC Extensions: View Patterns Domain: ocharles.org.uk, Score: 69, Comments: 39 Original: [25] http://goo.gl/uN3PLf On Reddit: [26] http://goo.gl/2YZ1r0 * Well-Typed are hiring! Domain: well-typed.com, Score: 68, Comments: 36 Original: [27] http://goo.gl/DxYgrT On Reddit: [28] http://goo.gl/2imRKu * 24 Days of GHC Extensions: Pattern Synonyms Domain: ocharles.org.uk, Score: 65, Comments: 20 Original: [29] http://goo.gl/j75DP8 On Reddit: [30] http://goo.gl/VTvCof * How lazy evaluation works Domain: hackhands.com, Score: 63, Comments: 30 Original: [31] http://goo.gl/YPOFaM On Reddit: [32] http://goo.gl/w2uKGJ * Learn You an Agda Domain: williamdemeo.github.io, Score: 59, Comments: 61 Original: [33] http://goo.gl/hQ5DaT On Reddit: [34] http://goo.gl/2I00Zh * 24 Days of GHC Extensions: Record Wildcards Domain: ocharles.org.uk, Score: 59, Comments: 38 Original: [35] http://goo.gl/BnXqjA On Reddit: [36] http://goo.gl/yBzMoY * Functional Programming Patterns (BuildStuff '14) Domain: slideshare.net, Score: 55, Comments: 15 Original: [37] http://goo.gl/fzo56I On Reddit: [38] http://goo.gl/XCy482 * The GHCJS guys are working on TH cross compiling Domain: thread.gmane.org, Score: 54, Comments: 15 Original: [39] http://goo.gl/XyA4FS On Reddit: [40] http://goo.gl/eRULJH * Silk is looking for a Haskell engineer Domain: self.haskell, Score: 53, Comments: 21 Original: [41] http://goo.gl/eB10Wa On Reddit: [42] http://goo.gl/eB10Wa * Keera studios: Haskell games & adventure engine for Android, beta testers wanted! Domain: keera.co.uk, Score: 53, Comments: 8 Original: [43] http://goo.gl/rk7Wrx On Reddit: [44] http://goo.gl/ciCbYp * 24 Days of GHC Extensions: Bang Patterns Domain: ocharles.org.uk, Score: 51, Comments: 34 Original: [45] http://goo.gl/X4Huvh On Reddit: [46] http://goo.gl/eHmymQ * Let's Build a Browser Engine in Haskell: part 6 Domain: hrothen.github.io, Score: 49, Comments: 4 Original: [47] http://goo.gl/mDnmpX On Reddit: [48] http://goo.gl/96aLMl * A Docker build script for GHC 7.8.3 cross-compiler targeting Android Domain: github.com, Score: 49, Comments: 21 Original: [49] http://goo.gl/uCsMNK On Reddit: [50] http://goo.gl/KvY3JX * amazonka - Comprehensive Amazon Web Services SDK Domain: self.haskell, Score: 46, Comments: 17 Original: [51] http://goo.gl/Yi18LS On Reddit: [52] http://goo.gl/Yi18LS * 24 Days of GHC Extensions: Rebindable Syntax (guest post by Benjamin Kovach) Domain: ocharles.org.uk, Score: 46, Comments: 14 Original: [53] http://goo.gl/7e3J1I On Reddit: [54] http://goo.gl/jJJONL * Haskell Communities and Activities Report ? November 2014 Domain: haskell.org, Score: 45, Comments: 6 Original: [55] http://goo.gl/7dfgQk On Reddit: [56] http://goo.gl/fME8UF * A taste of State: parsers are easy Domain: nikita-volkov.github.io, Score: 44, Comments: 4 Original: [57] http://goo.gl/HF4R3O On Reddit: [58] http://goo.gl/d7bLLV * Hybrid server/client Haskell web apps / Michael Snoyman Domain: youtube.com, Score: 42, Comments: 31 Original: [59] http://goo.gl/IbxCkI On Reddit: [60] http://goo.gl/Yjx8wj * Nix: The Cabal Purgatory HOWTO Domain: cse.chalmers.se, Score: 41, Comments: 45 Original: [61] http://goo.gl/pxdnYA On Reddit: [62] http://goo.gl/2uE8ya * Ranjit Jhala talks about Liquid Haskell Domain: youtu.be, Score: 41, Comments: 14 Original: [63] http://goo.gl/EAubrl On Reddit: [64] http://goo.gl/f1D8iz * A quick and easy Emacs configuration for Haskell Domain: github.com, Score: 39, Comments: 16 Original: [65] http://goo.gl/8akoJo On Reddit: [66] http://goo.gl/Ma8iDO Top StackOverflow Questions * Turning A => M[B] into M[A => B] votes: 22, answers: 2 Read on SO: [67] http://goo.gl/P4AXC2 * When are type signatures necessary in Haskell? votes: 19, answers: 3 Read on SO: [68] http://goo.gl/9YcgHo * Boilerplate-free annotation of ASTs in Haskell? votes: 18, answers: 4 Read on SO: [69] http://goo.gl/dNv5kU * Can fusion see through newtype wrappers? votes: 17, answers: 1 Read on SO: [70] http://goo.gl/00ONhp * Haskell: Why use Proxy? votes: 17, answers: 2 Read on SO: [71] http://goo.gl/bWRvVN * Is Haskell's laziness an elegant alternative to Python's generators? votes: 16, answers: 3 Read on SO: [72] http://goo.gl/oblTSW * Type inference interferes with referential transparency votes: 16, answers: 7 Read on SO: [73] http://goo.gl/2nIW1x * What exactly is the kind ?*? in Haskell? votes: 15, answers: 2 Read on SO: [74] http://goo.gl/sOXwgi * What's the difference between partial evaluation and function inlining in a functional language? votes: 14, answers: 1 Read on SO: [75] http://goo.gl/AOZuCH Until next time, [76]+Daniel Santa Cruz References 1. https://ocharles.org.uk/blog/posts/2014-12-01-24-days-of-ghc-extensions.html 2. http://www.reddit.com/r/haskell/comments/2nyy5z/24_days_of_ghc_extensions_welcome/ 3. http://howistart.org/posts/haskell/1 4. http://www.reddit.com/r/haskell/comments/2mkbay/how_i_start_haskell/ 5. http://chrisdone.com/posts/lucid 6. http://www.reddit.com/r/haskell/comments/2my5bc/lucid_templating_dsl_for_html/ 7. http://imgur.com/OQbeouW 8. http://www.reddit.com/r/haskell/comments/2o5m95/erik_meijer_planning_to_make_category_theory_for/ 9. http://www.reddit.com/r/haskell/comments/2nkjdq/an_opportunity_in_singapore/ 10. http://www.reddit.com/r/haskell/comments/2nkjdq/an_opportunity_in_singapore/ 11. https://plus.google.com/107913314994758123748/posts/9EQP1xqsQZ6 12. http://www.reddit.com/r/haskell/comments/2nsdkq/dan_piponi_working_on_an_audio_synthesis_tool/ 13. http://smart-cactus.org/~ben/posts/2014-11-28-state-of-llvm-backend.html 14. http://www.reddit.com/r/haskell/comments/2nphz5/ghc_and_llvm_the_state_of_the_union/ 15. http://superginbaby.wordpress.com/2014/11/18/learning-haskell-as-a-nonprogrammer/ 16. http://www.reddit.com/r/haskell/comments/2mp3fb/learning_haskell_as_a_nonprogrammer/ 17. http://www.reddit.com/r/haskell/comments/2nxx7n/announcing_opaleye_sqlgenerating_embedded_domain/ 18. http://www.reddit.com/r/haskell/comments/2nxx7n/announcing_opaleye_sqlgenerating_embedded_domain/ 19. https://halcyon.sh/ 20. http://www.reddit.com/r/haskell/comments/2ogoot/deploy_any_haskell_application_instantly/ 21. http://www.haskellforall.com/2014/11/how-to-build-library-agnostic-streaming.html 22. http://www.reddit.com/r/haskell/comments/2n8xo4/haskell_for_all_how_to_build_libraryagnostic/ 23. http://jaspervdj.be/posts/2014-11-27-comonads-image-processing.html 24. http://www.reddit.com/r/haskell/comments/2nmf5l/image_processing_with_comonads/ 25. https://ocharles.org.uk/blog/posts/2014-12-02-view-patterns.html 26. http://www.reddit.com/r/haskell/comments/2o341e/24_days_of_ghc_extensions_view_patterns/ 27. http://www.well-typed.com/blog/101/ 28. http://www.reddit.com/r/haskell/comments/2nlbei/welltyped_are_hiring/ 29. https://ocharles.org.uk/blog/posts/2014-12-03-pattern-synonyms.html 30. http://www.reddit.com/r/haskell/comments/2o6bq5/24_days_of_ghc_extensions_pattern_synonyms/ 31. https://hackhands.com/lazy-evaluation-works-haskell/ 32. http://www.reddit.com/r/haskell/comments/2n0991/how_lazy_evaluation_works/ 33. http://williamdemeo.github.io/2014/02/27/learn-you-an-agda/ 34. http://www.reddit.com/r/haskell/comments/2o49aw/learn_you_an_agda/ 35. https://ocharles.org.uk/blog/posts/2014-12-04-record-wildcards.html 36. http://www.reddit.com/r/haskell/comments/2oaj7e/24_days_of_ghc_extensions_record_wildcards/ 37. http://www.slideshare.net/ScottWlaschin/fp-patterns-buildstufflt 38. http://www.reddit.com/r/haskell/comments/2ntyqz/functional_programming_patterns_buildstuff_14/ 39. http://thread.gmane.org/gmane.comp.lang.haskell.ghc.devel/7299 40. http://www.reddit.com/r/haskell/comments/2o9fez/the_ghcjs_guys_are_working_on_th_cross_compiling/ 41. http://www.reddit.com/r/haskell/comments/2mok2d/silk_is_looking_for_a_haskell_engineer/ 42. http://www.reddit.com/r/haskell/comments/2mok2d/silk_is_looking_for_a_haskell_engineer/ 43. http://keera.co.uk/blog/2014/11/24/haskell-android-games-adventure-engine-beta-testing/ 44. http://www.reddit.com/r/haskell/comments/2nesiz/keera_studios_haskell_games_adventure_engine_for/ 45. https://ocharles.org.uk/blog/posts/2014-12-05-bang-patterns.html 46. http://www.reddit.com/r/haskell/comments/2oe1kk/24_days_of_ghc_extensions_bang_patterns/ 47. http://hrothen.github.io/2014/11/19/lets-build-a-browser-engine-in-haskell-part-6/ 48. http://www.reddit.com/r/haskell/comments/2mthmd/lets_build_a_browser_engine_in_haskell_part_6/ 49. https://github.com/sseefried/docker-build-ghc-android 50. http://www.reddit.com/r/haskell/comments/2n5njy/a_docker_build_script_for_ghc_783_crosscompiler/ 51. http://www.reddit.com/r/haskell/comments/2n2sgc/amazonka_comprehensive_amazon_web_services_sdk/ 52. http://www.reddit.com/r/haskell/comments/2n2sgc/amazonka_comprehensive_amazon_web_services_sdk/ 53. https://ocharles.org.uk/blog/guest-posts/2014-12-06-rebindable-syntax.html 54. http://www.reddit.com/r/haskell/comments/2ohm6p/24_days_of_ghc_extensions_rebindable_syntax_guest/ 55. https://www.haskell.org/communities/11-2014/report.pdf 56. http://www.reddit.com/r/haskell/comments/2mirc9/haskell_communities_and_activities_report/ 57. http://nikita-volkov.github.io/a-taste-of-state-parsers-are-easy/ 58. http://www.reddit.com/r/haskell/comments/2mk0ww/a_taste_of_state_parsers_are_easy/ 59. https://www.youtube.com/watch?v=XfINRj5OzGw 60. http://www.reddit.com/r/haskell/comments/2mhzj3/hybrid_serverclient_haskell_web_apps_michael/ 61. http://www.cse.chalmers.se/~bernardy/nix.html 62. http://www.reddit.com/r/haskell/comments/2mv3vo/nix_the_cabal_purgatory_howto/ 63. http://youtu.be/vYh27zz9530 64. http://www.reddit.com/r/haskell/comments/2nc9w6/ranjit_jhala_talks_about_liquid_haskell/ 65. https://github.com/chrisdone/emacs-haskell-config 66. http://www.reddit.com/r/haskell/comments/2oib5x/a_quick_and_easy_emacs_configuration_for_haskell/ 67. http://stackoverflow.com/questions/27267848/turning-a-mb-into-ma-b 68. http://stackoverflow.com/questions/27067905/when-are-type-signatures-necessary-in-haskell 69. http://stackoverflow.com/questions/27157717/boilerplate-free-annotation-of-asts-in-haskell 70. http://stackoverflow.com/questions/27014235/can-fusion-see-through-newtype-wrappers 71. http://stackoverflow.com/questions/27044209/haskell-why-use-proxy 72. http://stackoverflow.com/questions/26952366/is-haskells-laziness-an-elegant-alternative-to-pythons-generators 73. http://stackoverflow.com/questions/27019906/type-inference-interferes-with-referential-transparency 74. http://stackoverflow.com/questions/27095011/what-exactly-is-the-kind-in-haskell 75. http://stackoverflow.com/questions/26996110/whats-the-difference-between-partial-evaluation-and-function-inlining-in-a-func 76. https://plus.google.com/105107667630152149014/about -------------- next part -------------- An HTML attachment was scrubbed... URL: From neto at netowork.me Thu Dec 11 09:11:00 2014 From: neto at netowork.me (Ernesto Rodriguez) Date: Thu, 11 Dec 2014 10:11:00 +0100 Subject: [Haskell-cafe] Standard output of exec Message-ID: Dear All, I have a program which invokes an external program via exec. I wish to capture the standard output of the program without using external (temporary) files. Is it possible to create an in memory handle which I can tell exec to use as standard output of the invoked program. It would be great if it can be done without any extra dependencies. Best, -- Ernesto Rodriguez Masters Student Computer Science Utrecht University www.netowork.me github.com/netogallo -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at snoyman.com Thu Dec 11 09:18:31 2014 From: michael at snoyman.com (Michael Snoyman) Date: Thu, 11 Dec 2014 09:18:31 +0000 Subject: [Haskell-cafe] Standard output of exec References: Message-ID: You can use readProcess[1], but it has some downsides: 1. Can't specify all options to CreateProcess, e.g., working directory and environment variables. 2. Relies on lazy I/O I use Data.Conduit.Process[2] for this kind of thing, which has a full tutorial[3]. However, it *does* involve non-base dependencies. [1] http://www.stackage.org/haddock/2014-12-10-ghc78-exc/process-1.2.0.0/System-Process.html#v:readProcess [2] http://www.stackage.org/haddock/2014-12-10-ghc78-exc/conduit-extra-1.1.4.2/Data-Conduit-Process.html [3] https://www.fpcomplete.com/user/snoyberg/library-documentation/data-conduit-process?show=tutorials On Thu Dec 11 2014 at 11:11:12 AM Ernesto Rodriguez wrote: > Dear All, > > I have a program which invokes an external program via exec. I wish to > capture the standard output of the program without using external > (temporary) files. Is it possible to create an in memory handle which I can > tell exec to use as standard output of the invoked program. It would be > great if it can be done without any extra dependencies. > > Best, > > -- > Ernesto Rodriguez > > Masters Student > Computer Science > Utrecht University > > www.netowork.me > github.com/netogallo > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From neto at netowork.me Thu Dec 11 13:29:24 2014 From: neto at netowork.me (Ernesto Rodriguez) Date: Thu, 11 Dec 2014 14:29:24 +0100 Subject: [Haskell-cafe] Standard output of exec In-Reply-To: References: Message-ID: Hi Michael, Thank you for your answer. Conduits certainly are the best approach, but the output I am going to read is very short and the external program will only be called once or twice per execution so I think Lazy IO won't be problematic here. Best regards, Ernesto On Thu, Dec 11, 2014 at 10:18 AM, Michael Snoyman wrote: > You can use readProcess[1], but it has some downsides: > > 1. Can't specify all options to CreateProcess, e.g., working directory and > environment variables. > 2. Relies on lazy I/O > > I use Data.Conduit.Process[2] for this kind of thing, which has a full > tutorial[3]. However, it *does* involve non-base dependencies. > > [1] > http://www.stackage.org/haddock/2014-12-10-ghc78-exc/process-1.2.0.0/System-Process.html#v:readProcess > [2] > http://www.stackage.org/haddock/2014-12-10-ghc78-exc/conduit-extra-1.1.4.2/Data-Conduit-Process.html > [3] > https://www.fpcomplete.com/user/snoyberg/library-documentation/data-conduit-process?show=tutorials > > On Thu Dec 11 2014 at 11:11:12 AM Ernesto Rodriguez > wrote: > >> Dear All, >> >> I have a program which invokes an external program via exec. I wish to >> capture the standard output of the program without using external >> (temporary) files. Is it possible to create an in memory handle which I can >> tell exec to use as standard output of the invoked program. It would be >> great if it can be done without any extra dependencies. >> >> Best, >> >> -- >> Ernesto Rodriguez >> >> Masters Student >> Computer Science >> Utrecht University >> >> www.netowork.me >> github.com/netogallo >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > -- Ernesto Rodriguez Masters Student Computer Science Utrecht University www.netowork.me github.com/netogallo -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at snoyman.com Thu Dec 11 16:44:04 2014 From: michael at snoyman.com (Michael Snoyman) Date: Thu, 11 Dec 2014 16:44:04 +0000 Subject: [Haskell-cafe] Standard output of exec References: Message-ID: That's not going to be sufficient; you could end up in a deadlock by not flushing the output buffer of the child process. Have a look at the implementation of readProcess to see how to deal with some of these tricky issues in the lazy I/O world: http://hackage.haskell.org/package/process-1.2.0.0/docs/src/System-Process.html#readProcess On Thu Dec 11 2014 at 6:40:54 PM Derek McLoughlin < derek.mcloughlin at gmail.com> wrote: > Something like this would work: > > import System.Process > import System.IO > import System.Exit > > readExecOutput :: String -> [String] -> IO () > readExecOutput cmdName cmdOptions = do > (_, Just hOut, _, jHandle) <- > createProcess (proc cmdName cmdOptions) > { cwd = Just "." > , std_out = CreatePipe > } > exitCode <- waitForProcess jHandle > exec_output <- hGetContents hOut > case exitCode of > ExitSuccess -> putStr $ "Success!\n" ++ exec_output > _ -> putStrLn "Command failed" > > > Derek. > > On Thursday, 11 December 2014 13:29:34 UTC, Ernesto Rodriguez wrote: > >> Hi Michael, >> >> Thank you for your answer. Conduits certainly are the best approach, but >> the output I am going to read is very short and the external program will >> only be called once or twice per execution so I think Lazy IO won't be >> problematic here. >> >> Best regards, >> >> Ernesto >> > On Thu, Dec 11, 2014 at 10:18 AM, Michael Snoyman >> wrote: >> > You can use readProcess[1], but it has some downsides: >>> >>> 1. Can't specify all options to CreateProcess, e.g., working directory >>> and environment variables. >>> 2. Relies on lazy I/O >>> >>> I use Data.Conduit.Process[2] for this kind of thing, which has a full >>> tutorial[3]. However, it *does* involve non-base dependencies. >>> >>> [1] http://www.stackage.org/haddock/2014-12-10-ghc78-exc/ >>> process-1.2.0.0/System-Process.html#v:readProcess >>> [2] http://www.stackage.org/haddock/2014-12-10-ghc78-exc/ >>> conduit-extra-1.1.4.2/Data-Conduit-Process.html >>> [3] https://www.fpcomplete.com/user/snoyberg/library- >>> documentation/data-conduit-process?show=tutorials >>> >>> On Thu Dec 11 2014 at 11:11:12 AM Ernesto Rodriguez >>> wrote: >>> >> Dear All, >>>> >>>> I have a program which invokes an external program via exec. I wish to >>>> capture the standard output of the program without using external >>>> (temporary) files. Is it possible to create an in memory handle which I can >>>> tell exec to use as standard output of the invoked program. It would be >>>> great if it can be done without any extra dependencies. >>>> >>>> Best, >>>> >>>> -- >>>> Ernesto Rodriguez >>>> >>>> Masters Student >>>> Computer Science >>>> Utrecht University >>>> >>>> www.netowork.me >>>> github.com/netogallo >>>> >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> >>> Haskel... at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>> >> >> >> -- >> Ernesto Rodriguez >> >> Masters Student >> Computer Science >> Utrecht University >> >> www.netowork.me >> github.com/netogallo >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From donn at avvanta.com Thu Dec 11 17:10:40 2014 From: donn at avvanta.com (Donn Cave) Date: Thu, 11 Dec 2014 09:10:40 -0800 (PST) Subject: [Haskell-cafe] Standard output of exec In-Reply-To: References: Message-ID: <20141211171040.D4989F3939@mail.avvanta.com> On Thu, Dec 11, 2014 at 10:18 AM, Michael Snoyman wrote: > You can use readProcess[1], but it has some downsides: > > 1. Can't specify all options to CreateProcess, e.g., working directory and > environment variables. > > 2. Relies on lazy I/O I sure feel a pall of dread at the words "lazy I/O", but in this case, readProcess takes the curse off it by evaluating the output, am I right? Hence the repeated assurances in the documentation that it's strict. Donn From michael at snoyman.com Thu Dec 11 17:48:33 2014 From: michael at snoyman.com (Michael Snoyman) Date: Thu, 11 Dec 2014 17:48:33 +0000 Subject: [Haskell-cafe] Standard output of exec References: <20141211171040.D4989F3939@mail.avvanta.com> Message-ID: On Thu Dec 11 2014 at 7:10:51 PM Donn Cave wrote: > On Thu, Dec 11, 2014 at 10:18 AM, Michael Snoyman > wrote: > > > You can use readProcess[1], but it has some downsides: > > > > 1. Can't specify all options to CreateProcess, e.g., working directory > and > > environment variables. > > > > 2. Relies on lazy I/O > > I sure feel a pall of dread at the words "lazy I/O", but in this case, > readProcess takes the curse off it by evaluating the output, am I right? > Hence the repeated assurances in the documentation that it's strict. > > > I honestly don't know if the "curse" has been lifted in this case. It could be that readProcess is perfectly safe and (unlike hGetContents) doesn't have dangerous corner cases. I'm not certain. One other issue that I forgot to mention though is that you're required by the readProcess API to deal with the output from the process as textual data, which is often times not appropriate. And given how complicated the internals of readProcess are, it's highly unlikely someone would get that right on their first attempt to port the code to use ByteString. Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From diaz.carrete at gmail.com Thu Dec 11 20:37:14 2014 From: diaz.carrete at gmail.com (=?UTF-8?Q?Daniel_D=C3=ADaz?=) Date: Thu, 11 Dec 2014 12:37:14 -0800 (PST) Subject: [Haskell-cafe] Standard output of exec In-Reply-To: References: Message-ID: <42f03105-ded0-48e8-a003-72bb6b8a9f9d@googlegroups.com> You can also use my process-streaming library: import System.Process.Streaming import qualified Pipes.ByteString as B -- collects stdout as a lazy ByteString execute (pipeo (fromFold B.toLazyM)) (shell "echo test") It depends on the pipes ecosystem and some other stuff, however. Here are some examples. On Thursday, December 11, 2014 10:11:09 AM UTC+1, Ernesto Rodriguez wrote: > > Dear All, > > I have a program which invokes an external program via exec. I wish to > capture the standard output of the program without using external > (temporary) files. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zach.lists at gmail.com Fri Dec 12 01:43:58 2014 From: zach.lists at gmail.com (Zach Moazeni) Date: Thu, 11 Dec 2014 20:43:58 -0500 Subject: [Haskell-cafe] Linker troubles with cabal sandbox Message-ID: Hello folks, I'm getting some linker trouble in the form of: "Undefined symbols for architecture x86_64: ... ld: symbol(s) not found for architecture x86_64" When trying to compile a simple hashtables example https://hackage.haskell.org/package/hashtables-1.2.0.0 I came across a previous thread with a solution https://www.haskell.org/pipermail/haskell-cafe/2014-October/116469.html but it's not working for me. Here are the steps I'm taking and the verbose errors: https://gist.github.com/zmoazeni/b68c66f5e15654948946 Can someone give me a hand? Thanks! Zach -------------- next part -------------- An HTML attachment was scrubbed... URL: From zach.lists at gmail.com Fri Dec 12 02:35:43 2014 From: zach.lists at gmail.com (Zach Moazeni) Date: Thu, 11 Dec 2014 21:35:43 -0500 Subject: [Haskell-cafe] Linker troubles with cabal sandbox In-Reply-To: References: Message-ID: I believe I figured it out. I'm not passing enough parameters to ghc for the linker to fully resolve the dependencies. I was able to sort it out by generating a cabal file with "cabal init" and compiling with "cabal build" instead. Sorry for the noise! -Zach On Thu, Dec 11, 2014 at 8:43 PM, Zach Moazeni wrote: > Hello folks, > > I'm getting some linker trouble in the form of: > > "Undefined symbols for architecture x86_64: > ... > ld: symbol(s) not found for architecture x86_64" > > When trying to compile a simple hashtables example > https://hackage.haskell.org/package/hashtables-1.2.0.0 > > I came across a previous thread with a solution > https://www.haskell.org/pipermail/haskell-cafe/2014-October/116469.html > but it's not working for me. > > Here are the steps I'm taking and the verbose errors: > https://gist.github.com/zmoazeni/b68c66f5e15654948946 > > Can someone give me a hand? > > Thanks! > Zach > -------------- next part -------------- An HTML attachment was scrubbed... URL: From clintonmead at gmail.com Fri Dec 12 02:47:49 2014 From: clintonmead at gmail.com (Clinton Mead) Date: Fri, 12 Dec 2014 13:47:49 +1100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell Message-ID: Below are the `$` like operators in Haskell (view in fixed width): --------------------------------------------------------------------- | Function first | Op | Function second | Op | ------------------------------------------------------------------------------- | Plain | (a -> b) -> a -> b | $ | a -> (a -> b) -> b | | | Functor | (a -> b) -> f a -> f b | <$> | f a -> (a -> b) -> f b | | | Applicat| f (a -> b) -> f a -> f b | <*> | f a -> f (a -> b) -> f b | <**> | | Monad | (a -> m b) -> m a -> m b | =<< | m a -> (a -> m b) -> m b | >>= | ------------------------------------------------------------------------------- The "function second" forms I couldn't find for "plain" and "functor". What are the most common operators to used in these places? -------------- next part -------------- An HTML attachment was scrubbed... URL: From clintonmead at gmail.com Fri Dec 12 02:51:28 2014 From: clintonmead at gmail.com (Clinton Mead) Date: Fri, 12 Dec 2014 13:51:28 +1100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: References: Message-ID: I obviously had my table too wide in the last message, here it is again: ------------------------------------------------------------------- | Function first | Op | Function second | Op ------------------------------------------------------------------------- Plain | (a -> b) -> a -> b | $ | a -> (a -> b) -> b | Fnctr | (a -> b) -> f a -> f b | <$> | f a -> (a -> b) -> f b | Applc | f (a -> b) -> f a -> f b | <*> | f a -> f (a -> b) -> f b | <**> Monad | (a -> m b) -> m a -> m b | =<< | m a -> (a -> m b) -> m b | >>= ------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From tonymorris at gmail.com Fri Dec 12 02:54:21 2014 From: tonymorris at gmail.com (Tony Morris) Date: Fri, 12 Dec 2014 12:54:21 +1000 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: References: Message-ID: <548A58DD.4040901@gmail.com> Comonad :: (f a -> b) -> f a -> f b Contravariant :: (b -> a) -> f a -> f b Exponential :: (a -> b, b -> a) -> f a -> f b On 12/12/14 12:47, Clinton Mead wrote: > Below are the `$` like operators in Haskell (view in fixed width): > > --------------------------------------------------------------------- > | Function first | Op | Function second | > Op | > ------------------------------------------------------------------------------- > | Plain | (a -> b) -> a -> b | $ | a -> (a -> b) -> b | > | > | Functor | (a -> b) -> f a -> f b | <$> | f a -> (a -> b) -> f b > | | > | Applicat| f (a -> b) -> f a -> f b | <*> | f a -> f (a -> b) -> f b > | <**> | > | Monad | (a -> m b) -> m a -> m b | =<< | m a -> (a -> m b) -> m b > | >>= | > ------------------------------------------------------------------------------- > > The "function second" forms I couldn't find for "plain" and "functor". > What are the most common operators to used in these places? > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From danburton.email at gmail.com Fri Dec 12 02:58:46 2014 From: danburton.email at gmail.com (Dan Burton) Date: Thu, 11 Dec 2014 18:58:46 -0800 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: References: Message-ID: The lens package defines (&) and (<&>) as flipped ($) and (<$>), respectively. There is nothing in the base package that defines those. <&> is quite uncommon. Flipped ($) is something that crops up here and there. Sometimes called (|>), or (#). -- Dan Burton On Thu, Dec 11, 2014 at 6:47 PM, Clinton Mead wrote: > Below are the `$` like operators in Haskell (view in fixed width): > > > --------------------------------------------------------------------- > | Function first | Op | Function second | > Op | > > ------------------------------------------------------------------------------- > | Plain | (a -> b) -> a -> b | $ | a -> (a -> b) -> b | > | > | Functor | (a -> b) -> f a -> f b | <$> | f a -> (a -> b) -> f b | > | > | Applicat| f (a -> b) -> f a -> f b | <*> | f a -> f (a -> b) -> f b | > <**> | > | Monad | (a -> m b) -> m a -> m b | =<< | m a -> (a -> m b) -> m b | > >>= | > > ------------------------------------------------------------------------------- > > The "function second" forms I couldn't find for "plain" and "functor". > What are the most common operators to used in these places? > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.seefried at gmail.com Fri Dec 12 06:40:51 2014 From: sean.seefried at gmail.com (Sean Seefried) Date: Fri, 12 Dec 2014 17:40:51 +1100 Subject: [Haskell-cafe] Using Docker to ease the pain of building GHC Message-ID: Hi all, I wrote a blog post recently on my experience of using Docker to relieve the pain of developing a GHC cross compiler build script. I thought it might be helpful. http://lambdalog.seanseefried.com/posts/2014-12-12-docker-build-scripts.html Sean -------------- next part -------------- An HTML attachment was scrubbed... URL: From fabian.bergmark at gmail.com Fri Dec 12 07:01:06 2014 From: fabian.bergmark at gmail.com (Fabian Bergmark) Date: Fri, 12 Dec 2014 17:01:06 +1000 Subject: [Haskell-cafe] Typesafe API calls Message-ID: I just released a library on hackage (https://hackage.haskell.org/package/apis-0.0.0). The goal of the library is to provide typesafe API calls to a large amount of existing APIs. By typesafe I mean that, for each API the library provides two types, Input and Output, and a function :: Input -> IO Output. Internally the library knows how to serialize Input to make an HTTP request and how to deserialize the response into Output. Whats cool about this library is that it uses Template Haskell to generate the API interfaces. A combination of Open Data Tables, an internal YQL engine and JSON Schemas, all written in Haskell makes this possible. Right now only two APIs are included (Swedish weather data and Swedish public announcement), but more APIs are soon to follow. I have also implemented FFI exports of all types and functions so that, in combination with SWIG, this library can be used in almost any language. So far I have tried Java and Python with success. If anyone would like to try it and respond with feedback it would be greatly appreciated! If you want any specific API supported, I can try to import that right away Fabian Bergmark From vlatko.basic at gmail.com Fri Dec 12 07:12:50 2014 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Fri, 12 Dec 2014 08:12:50 +0100 Subject: [Haskell-cafe] Standard output of exec In-Reply-To: References: Message-ID: <548A9572.4050902@gmail.com> An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Fri Dec 12 10:21:10 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Fri, 12 Dec 2014 10:21:10 +0000 Subject: [Haskell-cafe] Typesafe multi-table PostgreSQL queries in Yesod with schema names? In-Reply-To: <20131120024205.GO16302@weber> References: <20131120024205.GO16302@weber> Message-ID: <20141212102110.GB6182@weber> On Wed, Nov 20, 2013 at 02:42:05AM +0000, Tom Ellis wrote: > On Tue, Nov 19, 2013 at 09:51:20PM -0430, Manuel G?mez wrote: > > I?m looking for a rather specific point in the design space for > > database access libraries in Haskell and I?m having some trouble > > figuring out whether any existing library covers my use cases. > > > > Specifically, I need to > > > > 1. get a Yesod application to access a PostgreSQL database without > > having to reinvent the universe to get them decently integrated, > > > > 2. write queries in an EDSL with a good approach to composability and > > decent static verification against some declared form of the database > > objects, > > > > 3. be able to perform joins > > > > 4. be able to specify the schema name for each database object used in queries > > I'm working on a Haskell relational query EDSL similar in spirit to > HaskellDB. It certainly satisfies your requirements 2 and 3. I'm not > exactly sure what exactly your requirements 1 and 4 mean but feel free to > contact me off list and we can discuss it further. For the sake of the mailing list archives I am replying here to confirm that my Haskell relational query language targeting Postgres has now indeed been published: http://hackage.haskell.org/package/opaleye Tom From wojtek at power.com.pl Fri Dec 12 13:15:10 2014 From: wojtek at power.com.pl (=?UTF-8?B?V29qdGVrIE5hcmN6ecWEc2tp?=) Date: Fri, 12 Dec 2014 14:15:10 +0100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: References: Message-ID: <548AEA5E.1010906@power.com.pl> On 12.12.2014 03:58, Dan Burton wrote: > The lens package defines (&) and (<&>) as flipped ($) and (<$>), > respectively. There is nothing in the base package that defines those. > <&> is quite uncommon. Flipped ($) is something that crops up here and > there. Sometimes called (|>), or (#). > > https://github.com/ghc/ghc/blob/master/libraries/base/Data/Function.hs A the bottom. -- /Since: 4.8.0.0/ (&) :: a -> (a -> b) -> b x & f = f x I learned about it from #haskell channel. -- Wojtek -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Fri Dec 12 13:22:16 2014 From: johan.tibell at gmail.com (Johan Tibell) Date: Fri, 12 Dec 2014 14:22:16 +0100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: <548AEA5E.1010906@power.com.pl> References: <548AEA5E.1010906@power.com.pl> Message-ID: Everything doesn't have to have an operator! We use operators a bit too much. It hurts readability of code when lines start looking like APL. On Fri, Dec 12, 2014 at 2:15 PM, Wojtek Narczy?ski wrote: > > > On 12.12.2014 03:58, Dan Burton wrote: > > The lens package defines (&) and (<&>) as flipped ($) and (<$>), > respectively. There is nothing in the base package that defines those. <&> > is quite uncommon. Flipped ($) is something that crops up here and there. > Sometimes called (|>), or (#). > > > > https://github.com/ghc/ghc/blob/master/libraries/base/Data/Function.hs > > A the bottom. > > -- /Since: 4.8.0.0/ > (&) :: a -> (a -> b) -> b > x & f = f x > > I learned about it from #haskell channel. > > -- > Wojtek > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at joachim-breitner.de Fri Dec 12 15:09:22 2014 From: mail at joachim-breitner.de (Joachim Breitner) Date: Fri, 12 Dec 2014 16:09:22 +0100 Subject: [Haskell-cafe] Typesafe API calls In-Reply-To: References: Message-ID: <1418396962.6490.2.camel@joachim-breitner.de> Hi reading the paragraph Am Freitag, den 12.12.2014, 17:01 +1000 schrieb Fabian Bergmark: > I just released a library on hackage > (https://hackage.haskell.org/package/apis-0.0.0). The goal of the > library is to provide typesafe API calls to a large amount of existing > APIs. By typesafe I mean that, for each API the library provides two > types, Input and Output, and a function :: Input -> IO Output. > Internally the library knows how to serialize Input to make an HTTP > request and how to deserialize the response into Output. made me feel old, as I first didn?t get what this was about, then started to wonder why HTTP appears in a message about application programming interfaces, and then noticed that this seems to be talking about ?Web-APIs?, which seem to be normal kind of APIs these days... Greetings, Joachim -- Joachim ?nomeata? Breitner mail at joachim-breitner.de ? http://www.joachim-breitner.de/ Jabber: nomeata at joachim-breitner.de ? GPG-Key: 0xF0FBF51F Debian Developer: nomeata at debian.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part URL: From kyle.marek.spartz at gmail.com Fri Dec 12 15:22:33 2014 From: kyle.marek.spartz at gmail.com (Kyle Marek-Spartz) Date: Fri, 12 Dec 2014 09:22:33 -0600 Subject: [Haskell-cafe] Typesafe API calls In-Reply-To: <1418396962.6490.2.camel@joachim-breitner.de> References: <1418396962.6490.2.camel@joachim-breitner.de> Message-ID: <2fcp3soar8opty.fsf@kmarekspartz-mbp.stp01.office.gdi> I'm not old either. This should clarify REST APIs. Haskell has type-safe API calls out of the box. Joachim Breitner writes: > Hi > > reading the paragraph > > Am Freitag, den 12.12.2014, 17:01 +1000 schrieb Fabian Bergmark: >> I just released a library on hackage >> (https://hackage.haskell.org/package/apis-0.0.0). The goal of the >> library is to provide typesafe API calls to a large amount of existing >> APIs. By typesafe I mean that, for each API the library provides two >> types, Input and Output, and a function :: Input -> IO Output. >> Internally the library knows how to serialize Input to make an HTTP >> request and how to deserialize the response into Output. > > made me feel old, as I first didn?t get what this was about, then > started to wonder why HTTP appears in a message about application > programming interfaces, and then noticed that this seems to be talking > about ?Web-APIs?, which seem to be normal kind of APIs these days... > > Greetings, > Joachim -- Kyle Marek-Spartz From wojtek at power.com.pl Fri Dec 12 15:25:25 2014 From: wojtek at power.com.pl (=?UTF-8?B?V29qY2llY2ggTmFyY3p5xYRza2k=?=) Date: Fri, 12 Dec 2014 16:25:25 +0100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: References: <548AEA5E.1010906@power.com.pl> Message-ID: <548B08E5.7000009@power.com.pl> W dniu 2014-12-12 o 14:22, Johan Tibell pisze: > Everything doesn't have to have an operator! We use operators a bit > too much. It hurts readability of code when lines start looking like APL. > Don't blame me, I'm responsible for exactly 0 operators. I just informed Clinton where (&) can be found. From omeragacan at gmail.com Fri Dec 12 15:58:43 2014 From: omeragacan at gmail.com (=?UTF-8?Q?=C3=96mer_Sinan_A=C4=9Facan?=) Date: Fri, 12 Dec 2014 17:58:43 +0200 Subject: [Haskell-cafe] Having a very annoying problem related with (I think) lazy IO Message-ID: Hi all, I'm having a horrible bug in my program: a print statement that doesn't force any values(e.g. it just prints a static string) effecting the behavior of the program. I tried hard to produce a minimal example, but couldn't manage it. So instead I'm just going to point to the source code of my program: https://github.com/osa1/rho-torrent/blob/master/src/Rho/Listener.hs#L125 If I remove this print statement everything goes weird. I think when I remove this statement some effects are not happening, or happening in wrong times. Here's how I'm testing the different behavior: This is a network application and I'm creating an environment in my system and making this program talk to another program. I run my program 10 times without the print statement, and run 10 times with it. Both groups produce same output in every time, but outputs of first group and second group are different from each other. (apart from extra prints, of course) So this print statement effects some other things, and expected behavior is the one happening with print statement. I know the program is big for anyone to figure things in short amount of time, I'm just looking for tips and pitfalls that I may be falling. Does anyone have any ideas what I may be doing wrong? Note that the program doesn't use any unsafe stuff. Thanks in advance. From shumovichy at gmail.com Fri Dec 12 16:20:18 2014 From: shumovichy at gmail.com (Yuras Shumovich) Date: Fri, 12 Dec 2014 19:20:18 +0300 Subject: [Haskell-cafe] Having a very annoying problem related with (I think) lazy IO In-Reply-To: References: Message-ID: <1418401218.2816.2.camel@gmail.com> What if you replace the `putStrLn` with `yield` or `threadDelay 1`? Probably the loop is too fast, and it doesn't give other parts of your program to take a lock. On Fri, 2014-12-12 at 17:58 +0200, ?mer Sinan A?acan wrote: > Hi all, > > I'm having a horrible bug in my program: a print statement that > doesn't force any values(e.g. it just prints a static string) > effecting the behavior of the program. > > I tried hard to produce a minimal example, but couldn't manage it. So > instead I'm just going to point to the source code of my program: > https://github.com/osa1/rho-torrent/blob/master/src/Rho/Listener.hs#L125 > > If I remove this print statement everything goes weird. I think when I > remove this statement some effects are not happening, or happening in > wrong times. > > Here's how I'm testing the different behavior: This is a network > application and I'm creating an environment in my system and making > this program talk to another program. > > I run my program 10 times without the print statement, and run 10 times with it. > > Both groups produce same output in every time, but outputs of first > group and second group are different from each other. (apart from > extra prints, of course) > > So this print statement effects some other things, and expected > behavior is the one happening with print statement. > > I know the program is big for anyone to figure things in short amount > of time, I'm just looking for tips and pitfalls that I may be falling. > Does anyone have any ideas what I may be doing wrong? Note that the > program doesn't use any unsafe stuff. > > Thanks in advance. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From omeragacan at gmail.com Fri Dec 12 16:33:39 2014 From: omeragacan at gmail.com (=?UTF-8?Q?=C3=96mer_Sinan_A=C4=9Facan?=) Date: Fri, 12 Dec 2014 18:33:39 +0200 Subject: [Haskell-cafe] Having a very annoying problem related with (I think) lazy IO In-Reply-To: <1418401218.2816.2.camel@gmail.com> References: <1418401218.2816.2.camel@gmail.com> Message-ID: Interesting, I think that worked. (I'll try on bigger examples and update again) > Probably the loop is too fast, and it doesn't give other parts of your program to take a lock. Are there any ways to test for this? How do I know if this is really the case? 2014-12-12 18:20 GMT+02:00 Yuras Shumovich : > What if you replace the `putStrLn` with `yield` or `threadDelay 1`? > Probably the loop is too fast, and it doesn't give other parts of your > program to take a lock. > > On Fri, 2014-12-12 at 17:58 +0200, ?mer Sinan A?acan wrote: >> Hi all, >> >> I'm having a horrible bug in my program: a print statement that >> doesn't force any values(e.g. it just prints a static string) >> effecting the behavior of the program. >> >> I tried hard to produce a minimal example, but couldn't manage it. So >> instead I'm just going to point to the source code of my program: >> https://github.com/osa1/rho-torrent/blob/master/src/Rho/Listener.hs#L125 >> >> If I remove this print statement everything goes weird. I think when I >> remove this statement some effects are not happening, or happening in >> wrong times. >> >> Here's how I'm testing the different behavior: This is a network >> application and I'm creating an environment in my system and making >> this program talk to another program. >> >> I run my program 10 times without the print statement, and run 10 times with it. >> >> Both groups produce same output in every time, but outputs of first >> group and second group are different from each other. (apart from >> extra prints, of course) >> >> So this print statement effects some other things, and expected >> behavior is the one happening with print statement. >> >> I know the program is big for anyone to figure things in short amount >> of time, I'm just looking for tips and pitfalls that I may be falling. >> Does anyone have any ideas what I may be doing wrong? Note that the >> program doesn't use any unsafe stuff. >> >> Thanks in advance. >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > From omeragacan at gmail.com Fri Dec 12 16:38:13 2014 From: omeragacan at gmail.com (=?UTF-8?Q?=C3=96mer_Sinan_A=C4=9Facan?=) Date: Fri, 12 Dec 2014 18:38:13 +0200 Subject: [Haskell-cafe] Having a very annoying problem related with (I think) lazy IO In-Reply-To: References: <1418401218.2816.2.camel@gmail.com> Message-ID: Amazing, that really worked. I'm still confused about why this is happening though. > it doesn't give other parts of your program to take a lock. What lock are we talking about here? 2014-12-12 18:33 GMT+02:00 ?mer Sinan A?acan : > Interesting, I think that worked. (I'll try on bigger examples and update again) > >> Probably the loop is too fast, and it doesn't give other parts of your > program to take a lock. > > Are there any ways to test for this? How do I know if this is really the case? > > 2014-12-12 18:20 GMT+02:00 Yuras Shumovich : >> What if you replace the `putStrLn` with `yield` or `threadDelay 1`? >> Probably the loop is too fast, and it doesn't give other parts of your >> program to take a lock. >> >> On Fri, 2014-12-12 at 17:58 +0200, ?mer Sinan A?acan wrote: >>> Hi all, >>> >>> I'm having a horrible bug in my program: a print statement that >>> doesn't force any values(e.g. it just prints a static string) >>> effecting the behavior of the program. >>> >>> I tried hard to produce a minimal example, but couldn't manage it. So >>> instead I'm just going to point to the source code of my program: >>> https://github.com/osa1/rho-torrent/blob/master/src/Rho/Listener.hs#L125 >>> >>> If I remove this print statement everything goes weird. I think when I >>> remove this statement some effects are not happening, or happening in >>> wrong times. >>> >>> Here's how I'm testing the different behavior: This is a network >>> application and I'm creating an environment in my system and making >>> this program talk to another program. >>> >>> I run my program 10 times without the print statement, and run 10 times with it. >>> >>> Both groups produce same output in every time, but outputs of first >>> group and second group are different from each other. (apart from >>> extra prints, of course) >>> >>> So this print statement effects some other things, and expected >>> behavior is the one happening with print statement. >>> >>> I know the program is big for anyone to figure things in short amount >>> of time, I'm just looking for tips and pitfalls that I may be falling. >>> Does anyone have any ideas what I may be doing wrong? Note that the >>> program doesn't use any unsafe stuff. >>> >>> Thanks in advance. >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> From shumovichy at gmail.com Fri Dec 12 16:53:15 2014 From: shumovichy at gmail.com (Yuras Shumovich) Date: Fri, 12 Dec 2014 19:53:15 +0300 Subject: [Haskell-cafe] Having a very annoying problem related with (I think) lazy IO In-Reply-To: References: <1418401218.2816.2.camel@gmail.com> Message-ID: <1418403195.2816.12.camel@gmail.com> Well, I'm not sure, I just wrote what my nose suggested me. I can't count how many times I got something similar in my own code, and each time it was a thread that runs too fast. I mean the `lock` at line 121 (`takeMVar lock`). I don't know whether it is used somewhere else though. It also could be `updated` MVar, or it is a flaw in ghc's scheduler... You can try ThreadScope (see e.g. https://www.haskell.org/haskellwiki/ThreadScope ) to see a difference between two versions (with and without `putStrLn`). It is hard to suggest anything specific without deep study. On Fri, 2014-12-12 at 18:38 +0200, ?mer Sinan A?acan wrote: > Amazing, that really worked. I'm still confused about why this is > happening though. > > > it doesn't give other parts of your program to take a lock. > > What lock are we talking about here? > > 2014-12-12 18:33 GMT+02:00 ?mer Sinan A?acan : > > Interesting, I think that worked. (I'll try on bigger examples and update again) > > > >> Probably the loop is too fast, and it doesn't give other parts of your > > program to take a lock. > > > > Are there any ways to test for this? How do I know if this is really the case? > > > > 2014-12-12 18:20 GMT+02:00 Yuras Shumovich : > >> What if you replace the `putStrLn` with `yield` or `threadDelay 1`? > >> Probably the loop is too fast, and it doesn't give other parts of your > >> program to take a lock. > >> > >> On Fri, 2014-12-12 at 17:58 +0200, ?mer Sinan A?acan wrote: > >>> Hi all, > >>> > >>> I'm having a horrible bug in my program: a print statement that > >>> doesn't force any values(e.g. it just prints a static string) > >>> effecting the behavior of the program. > >>> > >>> I tried hard to produce a minimal example, but couldn't manage it. So > >>> instead I'm just going to point to the source code of my program: > >>> https://github.com/osa1/rho-torrent/blob/master/src/Rho/Listener.hs#L125 > >>> > >>> If I remove this print statement everything goes weird. I think when I > >>> remove this statement some effects are not happening, or happening in > >>> wrong times. > >>> > >>> Here's how I'm testing the different behavior: This is a network > >>> application and I'm creating an environment in my system and making > >>> this program talk to another program. > >>> > >>> I run my program 10 times without the print statement, and run 10 times with it. > >>> > >>> Both groups produce same output in every time, but outputs of first > >>> group and second group are different from each other. (apart from > >>> extra prints, of course) > >>> > >>> So this print statement effects some other things, and expected > >>> behavior is the one happening with print statement. > >>> > >>> I know the program is big for anyone to figure things in short amount > >>> of time, I'm just looking for tips and pitfalls that I may be falling. > >>> Does anyone have any ideas what I may be doing wrong? Note that the > >>> program doesn't use any unsafe stuff. > >>> > >>> Thanks in advance. > >>> _______________________________________________ > >>> Haskell-Cafe mailing list > >>> Haskell-Cafe at haskell.org > >>> http://www.haskell.org/mailman/listinfo/haskell-cafe > >> > >> From guillaumh at gmail.com Fri Dec 12 17:19:31 2014 From: guillaumh at gmail.com (Guillaume Hoffmann) Date: Fri, 12 Dec 2014 14:19:31 -0300 Subject: [Haskell-cafe] gracefully invoking `less` using System.Process (and ignoring ctrl-c) Message-ID: Hi, I'm looking at a bug that we should fix for the 2.10 release of darcs. I'd like to make the invocation of the pager (most of the time `less`) as identical to git as possible. Currently darcs has a workaround for the "resource vanished (broken pipe)" problem (that happens when you leave `less` before all of the text has been read by it). The workaround involves creating a temporary file and then passing it to less [1]. This works but it's slow (for big inputs) and ugly IMO. I have a fix proposal [2] that is made of two changes: * use System.Process.createProcess (just to update the code), and * in the "ortryrunning" function (that chains attempts at calling various pagers until one works), ignoring IOError's of the kind ResourceVanished (otherwise we would invoke every pager in the chain if we quit them before they read all their input) The problem is that pressing CTRL-C in `less` now kills everything (darcs+less). Is there a way to fix this? Note that the darcs executable runs inside of the function withSignalHandled [3], which defines its behaviour with respect to various signals. Guillaume [1] http://hub.darcs.net/darcs/darcs-reviewed/browse/src/Darcs/UI/External.hs#464 [2] http://hub.darcs.net/gh/darcs-screened_1/patch/20141210002305-5ef8f [3] http://hub.darcs.net/darcs/darcs-reviewed/browse/src/Darcs/Util/SignalHandler.hs#55 From allbery.b at gmail.com Fri Dec 12 17:33:10 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Fri, 12 Dec 2014 12:33:10 -0500 Subject: [Haskell-cafe] gracefully invoking `less` using System.Process (and ignoring ctrl-c) In-Reply-To: References: Message-ID: On Fri, Dec 12, 2014 at 12:19 PM, Guillaume Hoffmann wrote: > > The problem is that pressing CTRL-C in `less` now kills everything > (darcs+less). > Is there a way to fix this? > On Unix you'd just arrange for your job to ignore sigINT itself, overriding the withSignalHandled setting. The various online documentation systems are all on Linux and don't document win32-specific modules as a result, but it looks like you might be able to use withCtrlCHandler id realActionGoesHere on Windows. (Someone with Windows knowledge needs to verify that; it's nested under another withCtrlCHandler in withSignalHandled, and I have no clue how they would interact.) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From donn at avvanta.com Fri Dec 12 18:19:03 2014 From: donn at avvanta.com (Donn Cave) Date: Fri, 12 Dec 2014 10:19:03 -0800 (PST) Subject: [Haskell-cafe] gracefully invoking `less` using System.Process (andignoring ctrl-c) In-Reply-To: References: Message-ID: <20141212181903.9D0CC276C52@mail.avvanta.com> Quoth Guillaume Hoffmann , ... > * use System.Process.createProcess (just to update the code), and > * in the "ortryrunning" function (that chains attempts at calling > various pagers until one works), ignoring IOError's of the kind > ResourceVanished (otherwise we would invoke every pager in the chain > if we quit them before they read all their input) > > The problem is that pressing CTRL-C in `less` now kills everything (darcs+less). And didn't before? Do you suppose, because of the createProcess? I don't keep track as well as I should, of the library's herculean efforts to support UNIX functionality like this on a platform independent layer, but I notice in the docs a "delegate_ctlc" option, and some discussion of it and pointers to more discussion, in System.Process. Does any of that help? Do you want to support this on Windows? Donn From allbery.b at gmail.com Fri Dec 12 18:21:04 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Fri, 12 Dec 2014 13:21:04 -0500 Subject: [Haskell-cafe] gracefully invoking `less` using System.Process (andignoring ctrl-c) In-Reply-To: <20141212181903.9D0CC276C52@mail.avvanta.com> References: <20141212181903.9D0CC276C52@mail.avvanta.com> Message-ID: On Fri, Dec 12, 2014 at 1:19 PM, Donn Cave wrote: > > > The problem is that pressing CTRL-C in `less` now kills everything > (darcs+less). > > And didn't before? Do you suppose, because of the createProcess? > The withSIgnalHandled function cited in the original message explicitly un-ignores SIGINT, which leads to the observed behavior. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From trebla at vex.net Fri Dec 12 20:02:37 2014 From: trebla at vex.net (Albert Y. C. Lai) Date: Fri, 12 Dec 2014 15:02:37 -0500 Subject: [Haskell-cafe] Typesafe API calls In-Reply-To: <2fcp3soar8opty.fsf@kmarekspartz-mbp.stp01.office.gdi> References: <1418396962.6490.2.camel@joachim-breitner.de> <2fcp3soar8opty.fsf@kmarekspartz-mbp.stp01.office.gdi> Message-ID: <548B49DD.7070100@vex.net> On 2014-12-12 10:22 AM, Kyle Marek-Spartz wrote: > I'm not old either. This should clarify REST APIs. Haskell has > type-safe API calls out of the box. I second lengthening the name and description to "type-safe web REST APIs", but my angle is different. You want to future-proof its name and description against some new future kind of APIs you and I have never dreamed of. From acfoltzer at gmail.com Fri Dec 12 21:58:26 2014 From: acfoltzer at gmail.com (Adam Foltzer) Date: Fri, 12 Dec 2014 13:58:26 -0800 Subject: [Haskell-cafe] Year-end deadline for Haskell.org donations Message-ID: Dear Haskellers, HaskellWiki, Hackage, Hoogle, and all the other Haskell.org sites we depend on are hosted with funds donated by you, the Haskell community. As many of us are in tax jurisdictions where December 31st is a deadline for charitable giving, I?d like to remind you that donations to support these activities are tax-deductible. You can donate online right now at https://co.clickandpledge.com/advanced/default.aspx?wid=69561. Last year was the first time we were able to seek your help while offering tax relief, and you came through: we raised nearly $900 in the span of a few days! This year, with almost three weeks left before the end of the year, I'd love to see us double that. It has been quite a year for Haskell.org: we migrated of most of our infrastructure, including Hackage, to Rackspace in order to improve reliability. We implemented new proxying to improve speed and performance, and improved the documentation and standardization of our server administration practices. Many of these accomplishments and much else are detailed by Austin Seipp at the new Haskell.org infrastructure blog at https://blog.haskell.org/post/the_new_haskell_org/. Let's keep the momentum going in 2015! Thank you and best wishes for a happy new year, Adam Foltzer & The Haskell.org Committee -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at proclivis.com Fri Dec 12 23:48:10 2014 From: mike at proclivis.com (Mike Jones) Date: Fri, 12 Dec 2014 16:48:10 -0700 Subject: [Haskell-cafe] Random pattern generation with list comprehensions Message-ID: <9EA1A2E7-40AE-4890-83E2-B41026B379D4@proclivis.com> I am looking for a way to generate random patterns for hardware validation. The goal is to separate patten generation from execution in hardware, and from pure code used to compute expected behavior from a model, detection of bad behavior, in the form of predicates, etc. The purpose of random patterns is to explore the behavior space in less time, as well as improve time to discovery by preventing long runs that focus in narrow areas for long periods. Patterns are to be infinite lists with the ability to specify run length for any run, which becomes a quality dial of sorts. I initially started with finite sequences expressed as list comprehensions, that generate tuples of ints, floats, structured data, and lists of attributes (bit combinations of hardware registers). I believe the list comprehension evaluates each generator (a | a <- ...) in a strict order, such that an infinite list will cause infinite evaluation of a single generator, such that other generators are not evaluated. Even if each generator is constrained (take n), results will not not be completely random. What I need is for each generator to supply one value each, and combine them into a tuple. I could probable express this in a monadic loop construct, as long as each generator is random and holds state, like the article I saw using the State Monad to generate random numbers. Or perhaps a State monad that holds multiple generators. Is there a better way to express the solution or a helpful module others use for this? Mike Sent from my iPad From travis.cardwell at extellisys.com Sat Dec 13 00:50:58 2014 From: travis.cardwell at extellisys.com (Travis Cardwell) Date: Sat, 13 Dec 2014 09:50:58 +0900 Subject: [Haskell-cafe] Standard output of exec In-Reply-To: References: <20141211171040.D4989F3939@mail.avvanta.com> Message-ID: <548B8D72.5090804@extellisys.com> On 2014?12?12? 02:48, Michael Snoyman wrote: > And given how complicated the > internals of readProcess are, it's highly unlikely someone would get that > right on their first attempt to port the code to use ByteString. In case anybody needs to use ByteString, you might want to try the process-extras package: http://hackage.haskell.org/package/process-extras Travis From mgsloan at gmail.com Sat Dec 13 03:16:10 2014 From: mgsloan at gmail.com (Michael Sloan) Date: Fri, 12 Dec 2014 19:16:10 -0800 Subject: [Haskell-cafe] Random pattern generation with list comprehensions In-Reply-To: <9EA1A2E7-40AE-4890-83E2-B41026B379D4@proclivis.com> References: <9EA1A2E7-40AE-4890-83E2-B41026B379D4@proclivis.com> Message-ID: Hello! It sounds like you're looking for the ParallelListComp language extension[1] Another option might be to leverage the Arbitrary typeclass in QuickCheck[2]. It has instances for tuples, so if each component of the tuple has an Arbitrary instance, you can generate the whole tuple with one invocation of "arbitrary". The CoArbitrary typeclass is also rather handy and clever, as it allows you to create random functions, as long as the arguments are instances of CoArbitrary and the result is an instance of Arbitrary. Your concept of specifying run length is very similar to QuickCheck's "size parameter". I hope that's helpful! -Michael [1] https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_guide/syntax-extns.html#parallel-list-comprehensions [2] http://hackage.haskell.org/package/QuickCheck From fabian.bergmark at gmail.com Sat Dec 13 04:50:23 2014 From: fabian.bergmark at gmail.com (Fabian Bergmark) Date: Sat, 13 Dec 2014 14:50:23 +1000 Subject: [Haskell-cafe] Typesafe API calls In-Reply-To: <548B49DD.7070100@vex.net> References: <1418396962.6490.2.camel@joachim-breitner.de> <2fcp3soar8opty.fsf@kmarekspartz-mbp.stp01.office.gdi> <548B49DD.7070100@vex.net> Message-ID: I have updated the package description on hackage. Does the package build correctly for you who have tried it? I think GHC ~ 7.8.3 is required because of PatternSynonyms in the ecma262 package. For you who try to add your own APIs, please email any bugs you encounter. The YQL engine is built on top of my ecma262 package which is incomplete. The core language should work, but specification functions such as Array.push etc. are left unimplemented for now. 2014-12-13 6:02 GMT+10:00 Albert Y. C. Lai : > On 2014-12-12 10:22 AM, Kyle Marek-Spartz wrote: >> >> I'm not old either. This should clarify REST APIs. Haskell has type-safe >> API calls out of the box. > > > I second lengthening the name and description to "type-safe web REST APIs", > but my angle is different. You want to future-proof its name and description > against some new future kind of APIs you and I have never dreamed of. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From alexander at plaimi.net Sat Dec 13 12:57:09 2014 From: alexander at plaimi.net (Alexander Berntsen) Date: Sat, 13 Dec 2014 13:57:09 +0100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: References: <548AEA5E.1010906@power.com.pl> Message-ID: <548C37A5.7030800@plaimi.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 12/12/14 14:22, Johan Tibell wrote: > Everything doesn't have to have an operator! We use operators a bit > too much. It hurts readability of code when lines start looking > like APL. I agree. Furthermore I think '$' (and by extension '&') is dreadful. We should have gone with '<|' and '|>' like e.g. F#. It is a shame that we do not have mnemonic operators for something so common. - -- Alexander alexander at plaimi.net https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlSMN6UACgkQRtClrXBQc7XPNQD/fQTogXC9exfzaLkcknS9yycU GLSNTs6K1l8GpHrFiqoA/0hrXO3D/9RrsYQtJjmZTZc9Ki8gDnOBBGuMEV8lWGsq =in8B -----END PGP SIGNATURE----- From wojtek at power.com.pl Sat Dec 13 16:08:25 2014 From: wojtek at power.com.pl (=?UTF-8?B?V29qY2llY2ggTmFyY3p5xYRza2k=?=) Date: Sat, 13 Dec 2014 17:08:25 +0100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: <548C37A5.7030800@plaimi.net> References: <548AEA5E.1010906@power.com.pl> <548C37A5.7030800@plaimi.net> Message-ID: <548C6479.1090308@power.com.pl> W dniu 2014-12-13 o 13:57, Alexander Berntsen pisze: > On 12/12/14 14:22, Johan Tibell wrote: >> Everything doesn't have to have an operator! We use operators a bit >> too much. It hurts readability of code when lines start looking >> like APL. > I agree. Furthermore I think '$' (and by extension '&') is dreadful. > We should have gone with '<|' and '|>' like e.g. F#. It is a shame > that we do not have mnemonic operators for something so common. > > Oh, I also agree. I find the F# code laid out like: theThing |> op1 |> op2 |> op2 visually pleasing and self understandable. It's not too late, these two operators are not taken. From alexander at plaimi.net Sat Dec 13 16:10:47 2014 From: alexander at plaimi.net (Alexander Berntsen) Date: Sat, 13 Dec 2014 17:10:47 +0100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: <548C6479.1090308@power.com.pl> References: <548AEA5E.1010906@power.com.pl> <548C37A5.7030800@plaimi.net> <548C6479.1090308@power.com.pl> Message-ID: <548C6507.5060603@plaimi.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 13/12/14 17:08, Wojciech Narczy?ski wrote: > It's not too late, these two operators are not taken. This has been discussed previously, but rejected for fear of namespace pollution. - -- Alexander alexander at plaimi.net https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlSMZQcACgkQRtClrXBQc7UbtAEAnVF0vLURDoZvM28c60QJwgPC TOjeZEEkMm6Rb5cEpocBAKsbwUq4/CFkNnNg5UXXp9AIUyPs9SqP9S/QCpA7ZECn =l1VB -----END PGP SIGNATURE----- From david.feuer at gmail.com Sat Dec 13 17:16:48 2014 From: david.feuer at gmail.com (David Feuer) Date: Sat, 13 Dec 2014 12:16:48 -0500 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: <548C6479.1090308@power.com.pl> References: <548AEA5E.1010906@power.com.pl> <548C37A5.7030800@plaimi.net> <548C6479.1090308@power.com.pl> Message-ID: It all depends what "taken" means. Data.Sequence uses <| for cons and |> for snoc. That may not have been the best decision, but it was made a long time ago. On Sat, Dec 13, 2014 at 11:08 AM, Wojciech Narczy?ski wrote: > W dniu 2014-12-13 o 13:57, Alexander Berntsen pisze: >> >> On 12/12/14 14:22, Johan Tibell wrote: >>> >>> Everything doesn't have to have an operator! We use operators a bit >>> too much. It hurts readability of code when lines start looking >>> like APL. >> >> I agree. Furthermore I think '$' (and by extension '&') is dreadful. >> We should have gone with '<|' and '|>' like e.g. F#. It is a shame >> that we do not have mnemonic operators for something so common. >> >> > Oh, I also agree. I find the F# code laid out like: > > theThing > |> op1 > |> op2 > |> op2 > > visually pleasing and self understandable. > > It's not too late, these two operators are not taken. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From wojtek at power.com.pl Sat Dec 13 21:38:32 2014 From: wojtek at power.com.pl (=?UTF-8?B?V29qdGVrIE5hcmN6ecWEc2tp?=) Date: Sat, 13 Dec 2014 22:38:32 +0100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: References: <548AEA5E.1010906@power.com.pl> <548C37A5.7030800@plaimi.net> <548C6479.1090308@power.com.pl> Message-ID: <548CB1D8.80309@power.com.pl> On 13.12.2014 18:16, David Feuer wrote: > It all depends what "taken" means. Data.Sequence uses <| for cons and > |> for snoc. That may not have been the best decision, but it was made > a long time ago. Oops, I certainly didn't mean that for "not taken"... From suhailshergill at gmail.com Sun Dec 14 04:11:04 2014 From: suhailshergill at gmail.com (Suhail Shergill) Date: Sun, 14 Dec 2014 04:11:04 +0000 Subject: [Haskell-cafe] extensible effects and open unions In-Reply-To: <20141202153135.A1518C3854@www1.g3.pair.com> (oleg@okmij.org's message of "Tue, 2 Dec 2014 10:31:35 -0500 (EST)") References: <87h9xjzm7t.fsf_-_@chaos.shergill.su> <20141202153135.A1518C3854@www1.g3.pair.com> Message-ID: <87ppbm6fc7.fsf@chaos.shergill.su> oleg at okmij.org writes: > First of all, thank you indeed for taking over as the maintainer of > the extensible-effects library. you're welcome! and thank you for the library in question to begin with; i intend to port the ideas to scala as well. > To show that one can indeed implement the interface of OpenUnion.hs as > it is *without* Typeable or overlapping instances, I have just written > http://okmij.org/ftp/Haskell/extensible/OpenUnion4.hs thanks for the concrete code sample. also, iiuc, if i were to back-port this code to ghc versions 7.6 and before, i should be able to do away with dependence on closed type families replacing it with overlapping instances. correct? if so, i'll try and expose that point in the design space as well since that would permit us to use effects in the return type of other 'Eff's even in systems not supporting closed type families. currently we have this for ghc-7.8 as can be seen in the contrived test here: > It is meant to be a drop-in replacement for OpenUnion2.hs. At least > for my Eff code, it does indeed act that way. Nothing in the code has > to be changed save for the import declaration. On the down side, in > OpenUnion4.hs, projections and injections take linear time in the size > of the union. How much difference it really makes in practice is > unclear (since the projection and injection operations can be computed > statically). Only benchmarks could tell. agreed. i am also contemplating breaking out open unions into an independent library. -- Suhail From ex8k.hibino at gmail.com Sun Dec 14 16:34:07 2014 From: ex8k.hibino at gmail.com (Kei Hibino) Date: Mon, 15 Dec 2014 01:34:07 +0900 (JST) Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL Message-ID: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> Hello everybody, I am happy to announce relational-record library and its project page. relational-record is domain specific language for type-safe SQL query building, and database access API with compile time schema generators. Code is avaiable on github and hackage. https://github.com/khibino/haskell-relational-record/ http://hackage.haskell.org/package/relational-record/ Tutorial, examples and documentations are available from project page links. http://khibino.github.io/haskell-relational-record/ Supported features are below, * Type safe query building. * Composable query. * Outer join. * Aggregation. * Compile time compile code generation along with RDBMS schema. * Schema support of ProsgreSQL, SQLite3, MySQL, IBM DB2, MicroSoft SQL Server, and Oracle. Any comments, any questions about this library are welcome. -- Kei Hibino ex8k.hibino at gmail.com https://github.com/khibino/ From targen at gmail.com Sun Dec 14 16:52:25 2014 From: targen at gmail.com (=?UTF-8?Q?Manuel_G=C3=B3mez?=) Date: Sun, 14 Dec 2014 12:22:25 -0430 Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> References: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> Message-ID: On Sun, Dec 14, 2014 at 12:04 PM, Kei Hibino wrote: > I am happy to announce relational-record library and its project page. > > relational-record is domain specific language for type-safe SQL query building, > and database access API with compile time schema generators. Congratulations on the release! It?s great to see more and more interesting abstractions for relational databases in the Haskell ecosystem. It looks like this project shares many goals with Tom Ellis? excellent and recently released[1] Opaleye library. How would you say your approach compares with Opaleye?s? [1]: From eyeinsky9 at gmail.com Sun Dec 14 19:46:52 2014 From: eyeinsky9 at gmail.com (Carl Eyeinsky) Date: Sun, 14 Dec 2014 21:46:52 +0200 Subject: [Haskell-cafe] managing local cabal package database Message-ID: Dear Cafe readers, I'm wondering what do you guys use as the general method in developing projects using your own private projects? Cabal allows to specify a directory for local packages ('local-repo' in '.cabal/config') with specific structure. Are there any scripts that take a git repo, checkout its tags one by one and put them in some specified directory in the correct way? The crude structure I'm imagining is that I'd like to reuse general purpose stuff I have made myself before, and have it available similar to having it in Hackage. Why I don't want to put my things in the Hackage itself, is that the code often changes fast, and would be little help to others until some later date, when things have calmed down.. (Does this seem a reasonable procedure, or how do you do it?) Cheers, -- Carl Eyeinsky -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at proclivis.com Sun Dec 14 18:54:12 2014 From: mike at proclivis.com (Michael Jones) Date: Sun, 14 Dec 2014 11:54:12 -0700 Subject: [Haskell-cafe] Random pattern generation with list comprehensions In-Reply-To: References: <9EA1A2E7-40AE-4890-83E2-B41026B379D4@proclivis.com> Message-ID: So, with ParallelListComp, because it is basically a zip, the evaluation will take one item from each generator, where generator is the v <- generator to the right of the ?|?. The implication being that if each generator produces random data, it will not evaluate each generator one by one in a systematic order, like multi digit counting. Basically it forces evaluation of each generator for each round, which would be like multi digit number generation where each digit changes with its own algorithm. If that is what it does, then this probably would work. I could create each generator within a State Monad, and use ParallelListComp to combine them, provided I can put a monadic operation in the comprehension. This page https://www.haskell.org/haskellwiki/List_comprehension seems to indicate it can't be directly done in a comprehension, which is limited to lists, and provides a do syntax alternative. I think that implies I can?t use ParallelListComp, and I would have to follow the examples on that page and zip things myself to force evaluation of each generator one by one. The alternative might be to make a State Monad where the State is a tuple with each item holding the state for each generator. Given that the number of items is fixed by hardware, I would not have to manage arbitrary tuple sizes. Each evaluation round of State would produce a tuple, and I would have to use a looping construct to generate values. QuickCheck is interesting, but I would prefer to draw on a simple language construct rather than take on a whole framework, unless there is no basic simple approach. Mike On Dec 12, 2014, at 8:16 PM, Michael Sloan wrote: > Hello! > > It sounds like you're looking for the ParallelListComp language extension[1] > > Another option might be to leverage the Arbitrary typeclass in > QuickCheck[2]. It has instances for tuples, so if each component of > the tuple has an Arbitrary instance, you can generate the whole tuple > with one invocation of "arbitrary". The CoArbitrary typeclass is also > rather handy and clever, as it allows you to create random functions, > as long as the arguments are instances of CoArbitrary and the result > is an instance of Arbitrary. Your concept of specifying run length is > very similar to QuickCheck's "size parameter". > > I hope that's helpful! > > -Michael > > [1] https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_guide/syntax-extns.html#parallel-list-comprehensions > [2] http://hackage.haskell.org/package/QuickCheck From kyle.marek.spartz at gmail.com Mon Dec 15 01:28:54 2014 From: kyle.marek.spartz at gmail.com (Kyle Marek-Spartz) Date: Sun, 14 Dec 2014 19:28:54 -0600 Subject: [Haskell-cafe] Random pattern generation with list comprehensions In-Reply-To: References: <9EA1A2E7-40AE-4890-83E2-B41026B379D4@proclivis.com> Message-ID: <2fcp3siohdn1k9.fsf@kmarekspartz-mbp.stp01.office.gdi> There's also Monad Comprehensions. A topical recent article: https://ocharles.org.uk/blog/guest-posts/2014-12-07-list-comprehensions.html Michael Jones writes: > So, with ParallelListComp, because it is basically a zip, the evaluation will take one item from each generator, where generator is the v <- generator to the right of the ?|?. > > The implication being that if each generator produces random data, it will not evaluate each generator one by one in a systematic order, like multi digit counting. Basically it forces evaluation of each generator for each round, which would be like multi digit number generation where each digit changes with its own algorithm. > > If that is what it does, then this probably would work. I could create each generator within a State Monad, and use ParallelListComp to combine them, provided I can put a monadic operation in the comprehension. > > This page https://www.haskell.org/haskellwiki/List_comprehension > > seems to indicate it can't be directly done in a comprehension, which is limited to lists, and provides a do syntax alternative. I think that implies I can?t use ParallelListComp, and I would have to follow the examples on that page and zip things myself to force evaluation of each generator one by one. > > The alternative might be to make a State Monad where the State is a tuple with each item holding the state for each generator. Given that the number of items is fixed by hardware, I would not have to manage arbitrary tuple sizes. Each evaluation round of State would produce a tuple, and I would have to use a looping construct to generate values. > > QuickCheck is interesting, but I would prefer to draw on a simple language construct rather than take on a whole framework, unless there is no basic simple approach. > > Mike > > On Dec 12, 2014, at 8:16 PM, Michael Sloan wrote: > >> Hello! >> >> It sounds like you're looking for the ParallelListComp language extension[1] >> >> Another option might be to leverage the Arbitrary typeclass in >> QuickCheck[2]. It has instances for tuples, so if each component of >> the tuple has an Arbitrary instance, you can generate the whole tuple >> with one invocation of "arbitrary". The CoArbitrary typeclass is also >> rather handy and clever, as it allows you to create random functions, >> as long as the arguments are instances of CoArbitrary and the result >> is an instance of Arbitrary. Your concept of specifying run length is >> very similar to QuickCheck's "size parameter". >> >> I hope that's helpful! >> >> -Michael >> >> [1] https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_guide/syntax-extns.html#parallel-list-comprehensions >> [2] http://hackage.haskell.org/package/QuickCheck > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Kyle Marek-Spartz From codygman.consulting at gmail.com Mon Dec 15 05:18:56 2014 From: codygman.consulting at gmail.com (Cody Goodman) Date: Sun, 14 Dec 2014 23:18:56 -0600 Subject: [Haskell-cafe] Converting non-primitive(?) recursive function to use scanl (or foldl maybe?) Message-ID: I've had some trouble wrapping my brain around how to use a scan to build this list: code below, but here's an lpaste link: http://lpaste.net/116494 {-# LANGUAGE OverloadedStrings #-} import Control.Monad import Data.Maybe import Text.Regex type RegexRes = Maybe (String, String, String, [String]) re = mkRegex "\\((\\w+)\\):([[:digit:]]+)" getParenNum :: String -> [String] getParenNum s = case matchRegexAll re s of Nothing -> [] Just (_,_,after,[word,num]) -> (word ++ num):getParenNum after getParenNumOnce' :: String -> String getParenNumOnce' s = case matchRegexAll re s of Nothing -> [] Just (_,_,after,[word,num]) -> (word ++ num) -- trying to accumulate the results of regexMatching repeatedly over a string f1 str = (\ (_, _, xs, acc) -> Just (xs, acc)) <=< (matchRegexAll re) $ str f2 str = fromMaybe "" $ (\ (_, _, after, [word,num]) -> Just after) <=< (matchRegexAll re) $ str -- f3 :: RegexRes -> RegexRes -- f3 :: RegexRes -> String f3 match = fromMaybe [] $ (\(_,_,after,[word,num]) -> Just (word ++ num)) =<< match f4 str = scanl (const f3) "" [(matchRegexAll re str)] f5 acc str = fromMaybe [] $ (\ (_, _, after, [word,num]) -> Just (acc ++ [word ++ num])) <=< (matchRegexAll re) $ str -- ?> scanl f5 [] ["(fish):1 sausage (cow):3 tree (boat):4"] -- [[],["fish1"]] str = "(fish):1 sausage (cow):3 tree (boat):4" -- ?> foldl (const . f3 . (matchRegexAll re)) "(fish):1 sausage (cow):3 tree (boat):4" ["(fish):1 sausage (cow):3 tree (boat):4"] -- "fish1" -- ?> -- want ["fish1","cow3","boat4"] -- ?> -- I feel like I should be using something in place of const that smartly chooses whether to pass String or... idk main = undefined From daniel.trstenjak at gmail.com Mon Dec 15 09:00:09 2014 From: daniel.trstenjak at gmail.com (Daniel Trstenjak) Date: Mon, 15 Dec 2014 10:00:09 +0100 Subject: [Haskell-cafe] managing local cabal package database In-Reply-To: References: Message-ID: <20141215090009.GA18274@machine> Hi Carl, > I'm wondering what do you guys use as the general method in developing projects > using your own private projects? Using a 'cabal sandbox' and its command 'add-source' to add a local library seems to be the way to go. Greetings, Daniel From michael at snoyman.com Mon Dec 15 09:00:48 2014 From: michael at snoyman.com (Michael Snoyman) Date: Mon, 15 Dec 2014 09:00:48 +0000 Subject: [Haskell-cafe] PVP question Message-ID: I'm a little bit uncertain of the PVP guidelines in a certain case[1], so I'd like to get some guidance/clarity. Suppose I have a library which provides the function: myFunction :: IO () myFunction = forever $ putStrLn "Still here" >> threadDelay 10^6 Later, I realize (or someone points out to me) that I've over-specified the type signature, and really myFunction should be: myFunction :: IO a In this case, does the PVP specify that we should have a minor or a major version bump? I'm not certain if this counts as a breaking change or not. [1] https://github.com/fpco/streaming-commons/pull/13 -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Mon Dec 15 09:44:18 2014 From: johan.tibell at gmail.com (Johan Tibell) Date: Mon, 15 Dec 2014 10:44:18 +0100 Subject: [Haskell-cafe] PVP question In-Reply-To: References: Message-ID: I think the question is: can this change cause existing code to stop compiling (perhaps assuming people aren't using -Werror)? I don't think it can but perhaps generalizing the type could make type inference fail somewhere due to an ambiguous type. We really need a PVP guide that just lists lots of examples, each with a note of what kind of change it is (i.e. major, minor, or patch). On Mon, Dec 15, 2014 at 10:00 AM, Michael Snoyman wrote: > > I'm a little bit uncertain of the PVP guidelines in a certain case[1], so > I'd like to get some guidance/clarity. Suppose I have a library which > provides the function: > > myFunction :: IO () > myFunction = forever $ putStrLn "Still here" >> threadDelay 10^6 > > Later, I realize (or someone points out to me) that I've over-specified > the type signature, and really myFunction should be: > > myFunction :: IO a > > In this case, does the PVP specify that we should have a minor or a major > version bump? I'm not certain if this counts as a breaking change or not. > > [1] https://github.com/fpco/streaming-commons/pull/13 > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dreixel at gmail.com Mon Dec 15 10:46:29 2014 From: dreixel at gmail.com (=?UTF-8?Q?Jos=C3=A9_Pedro_Magalh=C3=A3es?=) Date: Mon, 15 Dec 2014 10:46:29 +0000 Subject: [Haskell-cafe] Year-end deadline for Haskell.org donations In-Reply-To: References: Message-ID: I'd like to donate, but I must say I feel slightly doubtful about the donation page (see screenshot). The URL or the page text doesn't really mention Haskell or any details about the donation, the certificate doesn't seem to have Extended Validation, the labels for the steps 1..5 are missing, the T&C is empty... all in all, it doesn't look like a page where I want to enter my credit card details. So, I guess I have two questions: 1) Is this really safe, and will my money go to haskell.org? 2) Can't we come up with a more trustworthy-looking donation website? Thanks, Pedro On Fri, Dec 12, 2014 at 9:58 PM, Adam Foltzer wrote: > > Dear Haskellers, > > HaskellWiki, Hackage, Hoogle, and all the other Haskell.org sites we > depend on are hosted with funds donated by you, the Haskell community. As > many of us are in tax jurisdictions where December 31st is a deadline for > charitable giving, I?d like to remind you that donations to support these > activities are tax-deductible. You can donate online right now at > https://co.clickandpledge.com/advanced/default.aspx?wid=69561. > > Last year was the first time we were able to seek your help while offering > tax relief, and you came through: we raised nearly $900 in the span of a > few days! This year, with almost three weeks left before the end of the > year, I'd love to see us double that. > > It has been quite a year for Haskell.org: we migrated of most of our > infrastructure, including Hackage, to Rackspace in order to > improve reliability. We implemented new proxying to improve speed and > performance, and improved the documentation and standardization of our > server administration practices. Many of these accomplishments and much > else are detailed by Austin Seipp at the new Haskell.org infrastructure > blog at https://blog.haskell.org/post/the_new_haskell_org/. Let's keep > the momentum going in 2015! > > Thank you and best wishes for a happy new year, > Adam Foltzer & The Haskell.org Committee > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: donate 1.png Type: image/png Size: 65707 bytes Desc: not available URL: From horstmey at Mathematik.Uni-Marburg.de Mon Dec 15 13:57:20 2014 From: horstmey at Mathematik.Uni-Marburg.de (Thomas Horstmeyer) Date: Mon, 15 Dec 2014 14:57:20 +0100 Subject: [Haskell-cafe] Converting non-primitive(?) recursive function to use scanl (or foldl maybe?) In-Reply-To: References: Message-ID: <548EE8C0.7080401@informatik.uni-marburg.de> I would solve this using unfoldr from Data.List. f :: Maybe (String, String, String, [String]) -> Maybe (String, String) f = fmap (\(_,_, rest, xs) -> (concat xs, rest)) -- *Main> unfoldr (f . matchRegexAll re) str -- ["fish1","cow3","boat4"] HTH Thomas Am 15.12.2014 um 06:18 schrieb Cody Goodman: > I've had some trouble wrapping my brain around how to use a scan to > build this list: > > code below, but here's an lpaste link: http://lpaste.net/116494 > > {-# LANGUAGE OverloadedStrings #-} > import Control.Monad > import Data.Maybe > import Text.Regex > > type RegexRes = Maybe (String, String, String, [String]) > > re = mkRegex "\\((\\w+)\\):([[:digit:]]+)" > > getParenNum :: String -> [String] > getParenNum s = case matchRegexAll re s of > Nothing -> [] > Just (_,_,after,[word,num]) -> (word ++ num):getParenNum after > > getParenNumOnce' :: String -> String > getParenNumOnce' s = case matchRegexAll re s of > Nothing -> [] > Just (_,_,after,[word,num]) -> (word ++ num) > > -- trying to accumulate the results of regexMatching repeatedly over a string > f1 str = (\ (_, _, xs, acc) -> Just (xs, acc)) <=< (matchRegexAll re) $ str > > f2 str = fromMaybe "" $ (\ (_, _, after, [word,num]) -> Just after) > <=< (matchRegexAll re) $ str > > -- f3 :: RegexRes -> RegexRes > -- f3 :: RegexRes -> String > f3 match = fromMaybe [] $ (\(_,_,after,[word,num]) -> Just (word ++ > num)) =<< match > > f4 str = scanl (const f3) "" [(matchRegexAll re str)] > > f5 acc str = fromMaybe [] $ (\ (_, _, after, [word,num]) -> Just (acc > ++ [word ++ num])) <=< (matchRegexAll re) $ str > -- ?> scanl f5 [] ["(fish):1 sausage (cow):3 tree (boat):4"] > -- [[],["fish1"]] > > str = "(fish):1 sausage (cow):3 tree (boat):4" > > -- ?> foldl (const . f3 . (matchRegexAll re)) "(fish):1 sausage > (cow):3 tree (boat):4" ["(fish):1 sausage (cow):3 tree (boat):4"] > -- "fish1" > -- ?> -- want ["fish1","cow3","boat4"] > -- ?> -- I feel like I should be using something in place of const > that smartly chooses whether to pass String or... idk > > main = undefined > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From hjgtuyl at chello.nl Mon Dec 15 14:11:36 2014 From: hjgtuyl at chello.nl (Henk-Jan van Tuyl) Date: Mon, 15 Dec 2014 15:11:36 +0100 Subject: [Haskell-cafe] No handles from createProcess Message-ID: L.S., I am experimenting with the createProcess function from the package "process"; this function does not return any handle, on both Ubuntu and Windows. I am doing something wrong, or is this a bug? (I am using GHC 7.8.3 on both platforms.) The program I am running: ---?---------------------------------------------- import System.IO import System.Process f = do ( maybeStdinHandel , maybeStdoutHandel , maybeStderrHandel , processHandle ) <- createProcess (proc "cat" ["a.txt"]) case maybeStdinHandel of Just stdinHandel -> do putStrLn "stdin" _ -> putStrLn "No stdin handle" case maybeStdoutHandel of Just stdoutHandel -> do putStrLn "stdout" putStrLn =<< hGetContents stdoutHandel _ -> putStrLn "No stdout handle" case maybeStderrHandel of Just stderrHandel -> do putStrLn "stderr" putStrLn =<< hGetContents stderrHandel _ -> putStrLn "No stderr handle" main = f ---?---------------------------------------------- The output: ---?---------------------------------------------- $ ./ProcessTry No stdin handle No stdout handle No stderr handle asdf ---?---------------------------------------------- (asdf is the contents of file a.txt) Regards, Henk-Jan van Tuyl -- Folding at home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming -- From erantapaa at gmail.com Mon Dec 15 15:14:58 2014 From: erantapaa at gmail.com (Erik Rantapaa) Date: Mon, 15 Dec 2014 07:14:58 -0800 (PST) Subject: [Haskell-cafe] Random pattern generation with list comprehensions In-Reply-To: References: <9EA1A2E7-40AE-4890-83E2-B41026B379D4@proclivis.com> Message-ID: <2bd3631a-4d11-40ec-b3fc-c76eab84bb5d@googlegroups.com> On Sunday, December 14, 2014 5:22:14 PM UTC-6, Michael Jones wrote: > > The alternative might be to make a State Monad where the State is a tuple > with each item holding the state for each generator. > There is a common technique of using `split` and `randoms` (or `randomsR`) to create a pure list of random values which you might find helpful. Here is an example: {-# LANGUAGE ParallelListComp #-} import System.Random main = do g <- newStdGen let (g1,g2) = split g letters = randomRs ('a','z') g1 numbers = randomRs (15,35) g2 :: [Int] pairs = [ (a,n) | (a,n) <- zip letters numbers ] pairs2 = [ (a,n) | a <- letters | n <- numbers ] print $ take 10 pairs print $ take 10 pairs2 -- produces the same list of pairs -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at bergmark.nl Mon Dec 15 12:16:45 2014 From: adam at bergmark.nl (Adam Bergmark) Date: Mon, 15 Dec 2014 13:16:45 +0100 Subject: [Haskell-cafe] PVP question In-Reply-To: References: Message-ID: To be nitpicky myFunction >>= \() -> x would break. It's unlikely that anyone uses it like this, but I've been on the safe side in the past and major bumped for cases like this. I think it's unwise to take shortcuts in the other direction. - Adam On Mon, Dec 15, 2014 at 10:44 AM, Johan Tibell wrote: > > I think the question is: can this change cause existing code to stop > compiling (perhaps assuming people aren't using -Werror)? I don't think it > can but perhaps generalizing the type could make type inference fail > somewhere due to an ambiguous type. > > We really need a PVP guide that just lists lots of examples, each with a > note of what kind of change it is (i.e. major, minor, or patch). > > On Mon, Dec 15, 2014 at 10:00 AM, Michael Snoyman > wrote: > >> I'm a little bit uncertain of the PVP guidelines in a certain case[1], so >> I'd like to get some guidance/clarity. Suppose I have a library which >> provides the function: >> >> myFunction :: IO () >> myFunction = forever $ putStrLn "Still here" >> threadDelay 10^6 >> >> Later, I realize (or someone points out to me) that I've over-specified >> the type signature, and really myFunction should be: >> >> myFunction :: IO a >> >> In this case, does the PVP specify that we should have a minor or a major >> version bump? I'm not certain if this counts as a breaking change or not. >> >> [1] https://github.com/fpco/streaming-commons/pull/13 >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at bergmark.nl Mon Dec 15 12:19:26 2014 From: adam at bergmark.nl (Adam Bergmark) Date: Mon, 15 Dec 2014 13:19:26 +0100 Subject: [Haskell-cafe] PVP question In-Reply-To: References: Message-ID: Woah i shouldn't be nitpicky when I'm confused :-) Sorry. On Mon, Dec 15, 2014 at 1:16 PM, Adam Bergmark wrote: > > To be nitpicky myFunction >>= \() -> x would break. It's unlikely that > anyone uses it like this, but I've been on the safe side in the past and > major bumped for cases like this. I think it's unwise to take shortcuts in > the other direction. > > - Adam > > > > On Mon, Dec 15, 2014 at 10:44 AM, Johan Tibell > wrote: >> >> I think the question is: can this change cause existing code to stop >> compiling (perhaps assuming people aren't using -Werror)? I don't think it >> can but perhaps generalizing the type could make type inference fail >> somewhere due to an ambiguous type. >> >> We really need a PVP guide that just lists lots of examples, each with a >> note of what kind of change it is (i.e. major, minor, or patch). >> >> On Mon, Dec 15, 2014 at 10:00 AM, Michael Snoyman >> wrote: >> >>> I'm a little bit uncertain of the PVP guidelines in a certain case[1], >>> so I'd like to get some guidance/clarity. Suppose I have a library which >>> provides the function: >>> >>> myFunction :: IO () >>> myFunction = forever $ putStrLn "Still here" >> threadDelay 10^6 >>> >>> Later, I realize (or someone points out to me) that I've over-specified >>> the type signature, and really myFunction should be: >>> >>> myFunction :: IO a >>> >>> In this case, does the PVP specify that we should have a minor or a >>> major version bump? I'm not certain if this counts as a breaking change or >>> not. >>> >>> [1] https://github.com/fpco/streaming-commons/pull/13 >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From eyeinsky9 at gmail.com Mon Dec 15 12:34:32 2014 From: eyeinsky9 at gmail.com (Carl Eyeinsky) Date: Mon, 15 Dec 2014 13:34:32 +0100 Subject: [Haskell-cafe] managing local cabal package database In-Reply-To: <20141215090009.GA18274@machine> References: <20141215090009.GA18274@machine> Message-ID: Hi Daniel (and other readers), the use case is that if I have several versions of the private dependency. I.e I develop a project A, and after a while I find, that part of it wold be useful to break out to another package, so I make a package X and list it as dependencie. Here, 'add-source' works. BUT, some time later I'm done with A, and start developing B, and include X as a dependencie. Then, I find that X could use some improvements -- but after these my project A probably breaks due to these changes. The solution, of course, is versioning, but I think 'add-source' doesn't help there anymore (right?), unless I copy the head to another directory and do the improvements there. This last mentioned way (of leaving a trail of previous versions) is a manual way of version management. What I was thinking of is that, is there some paved solution available (short of running my own Hackage, which some do, as I've been reading.) Sorry -- I should have been much more explicit! Cheers, On Mon, Dec 15, 2014 at 10:00 AM, Daniel Trstenjak < daniel.trstenjak at gmail.com> wrote: > > > Hi Carl, > > > I'm wondering what do you guys use as the general method in developing > projects > > using your own private projects? > > Using a 'cabal sandbox' and its command 'add-source' to add a local > library seems to be the way to go. > > > Greetings, > Daniel > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Carl Eyeinsky -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Mon Dec 15 16:23:49 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 15 Dec 2014 11:23:49 -0500 Subject: [Haskell-cafe] No handles from createProcess In-Reply-To: References: Message-ID: On Mon, Dec 15, 2014 at 9:11 AM, Henk-Jan van Tuyl wrote: > > I am experimenting with the createProcess function from the package > "process"; this function does not return any handle, on both Ubuntu and > Windows. I am doing something wrong, or is this a bug? (I am using GHC > 7.8.3 on both platforms.) > Not a bug; you need to tell it which ones to create handles for. createProcess > > returns (mb_stdin_hdl, mb_stdout_hdl, mb_stderr_hdl, p), where > > - if std_in == CreatePipe, then mb_stdin_hdl will be Just h, where h is > the write end of the pipe connected to the child process's stdin. > - otherwise, mb_stdin_hdl == Nothing > > Similarly for mb_stdout_hdl and mb_stderr_hdl. > The default action is to inherit the existing handles for stdin/out/err in the subprocess and provide no handles to the caller; this mirrors the default behavior of creating a new process on Windows and POSIX. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From roma at ro-che.info Mon Dec 15 16:27:29 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Mon, 15 Dec 2014 18:27:29 +0200 Subject: [Haskell-cafe] No handles from createProcess In-Reply-To: References: Message-ID: <548F0BF1.2010603@ro-che.info> The documentation for createProcess seems pretty clear on this: if std_in == CreatePipe, then mb_stdin_hdl will be Just h, where h is the write end of the pipe connected to the child process's stdin. otherwise, mb_stdin_hdl == Nothing Similarly for mb_stdout_hdl and mb_stderr_hdl. proc doesn't set std_in to CreatePipe; you need to do that yourself if you need it. On 15/12/14 16:11, Henk-Jan van Tuyl wrote: > > L.S., > > I am experimenting with the createProcess function from the package > "process"; this function does not return any handle, on both Ubuntu and > Windows. I am doing something wrong, or is this a bug? (I am using GHC > 7.8.3 on both platforms.) > > The program I am running: > ---?---------------------------------------------- > import System.IO > import System.Process > > f = > do > ( maybeStdinHandel > , maybeStdoutHandel > , maybeStderrHandel > , processHandle > ) <- createProcess (proc "cat" ["a.txt"]) > case maybeStdinHandel of > Just stdinHandel -> > do > putStrLn "stdin" > _ -> putStrLn "No stdin handle" > case maybeStdoutHandel of > Just stdoutHandel -> > do > putStrLn "stdout" > putStrLn =<< hGetContents stdoutHandel > _ -> putStrLn "No stdout handle" > case maybeStderrHandel of > Just stderrHandel -> > do > putStrLn "stderr" > putStrLn =<< hGetContents stderrHandel > _ -> putStrLn "No stderr handle" > > main = f > ---?---------------------------------------------- > > The output: > ---?---------------------------------------------- > $ ./ProcessTry > No stdin handle > No stdout handle > No stderr handle > asdf > ---?---------------------------------------------- > (asdf is the contents of file a.txt) > > Regards, > Henk-Jan van Tuyl > > From roma at ro-che.info Mon Dec 15 17:10:24 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Mon, 15 Dec 2014 19:10:24 +0200 Subject: [Haskell-cafe] PVP question In-Reply-To: References: Message-ID: <548F1600.4030700@ro-che.info> Almost any API change can break existing code. For example, adding a new function can break code. I thought the guiding principle for PVP was how likely it is that a piece of client code will break, not if that's theoretically possible. On 15/12/14 11:44, Johan Tibell wrote: > I think the question is: can this change cause existing code to stop > compiling (perhaps assuming people aren't using -Werror)? I don't think > it can but perhaps generalizing the type could make type inference fail > somewhere due to an ambiguous type. > > We really need a PVP guide that just lists lots of examples, each with a > note of what kind of change it is (i.e. major, minor, or patch). > > On Mon, Dec 15, 2014 at 10:00 AM, Michael Snoyman > wrote: > > I'm a little bit uncertain of the PVP guidelines in a certain > case[1], so I'd like to get some guidance/clarity. Suppose I have a > library which provides the function: > > myFunction :: IO () > myFunction = forever $ putStrLn "Still here" >> threadDelay 10^6 > > Later, I realize (or someone points out to me) that I've > over-specified the type signature, and really myFunction should be: > > myFunction :: IO a > > In this case, does the PVP specify that we should have a minor or a > major version bump? I'm not certain if this counts as a breaking > change or not. > > [1] https://github.com/fpco/streaming-commons/pull/13 From adam at bergmark.nl Mon Dec 15 17:18:55 2014 From: adam at bergmark.nl (Adam Bergmark) Date: Mon, 15 Dec 2014 18:18:55 +0100 Subject: [Haskell-cafe] managing local cabal package database In-Reply-To: References: <20141215090009.GA18274@machine> Message-ID: I'm afraid I can't offer you any solutions yet, but here's how we do it: We run our own hackage and have a wrapper around cabal that uses a separate sandbox for each git branch. We also have one repository that contains most of our cabal projects, submodules add a lot of overhead. This all works well for local development but causes some problems with CI since we can only increment version numbers on the master branch, non-master builds need to checkout and build from the repository. I'd like to be able to use git hashes as version numbers, and thinking about it it may actually fit into our current workflow. I'll have to try it out :) - Adam On Mon, Dec 15, 2014 at 1:34 PM, Carl Eyeinsky wrote: > > Hi Daniel (and other readers), > > > the use case is that if I have several versions of the private dependency. > > I.e I develop a project A, and after a while I find, that part of it wold > be useful to break out to another package, so I make a package X and list > it as dependencie. Here, 'add-source' works. BUT, some time later I'm done > with A, and start developing B, and include X as a dependencie. Then, I > find that X could use some improvements -- but after these my project A > probably breaks due to these changes. The solution, of course, is > versioning, but I think 'add-source' doesn't help there anymore (right?), > unless I copy the head to another directory and do the improvements there. > > This last mentioned way (of leaving a trail of previous versions) is a > manual way of version management. What I was thinking of is that, is there > some paved solution available (short of running my own Hackage, which some > do, as I've been reading.) > > Sorry -- I should have been much more explicit! > > > Cheers, > > > On Mon, Dec 15, 2014 at 10:00 AM, Daniel Trstenjak < > daniel.trstenjak at gmail.com> wrote: >> >> >> Hi Carl, >> >> > I'm wondering what do you guys use as the general method in developing >> projects >> > using your own private projects? >> >> Using a 'cabal sandbox' and its command 'add-source' to add a local >> library seems to be the way to go. >> >> >> Greetings, >> Daniel >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > -- > Carl Eyeinsky > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.trstenjak at gmail.com Mon Dec 15 17:26:17 2014 From: daniel.trstenjak at gmail.com (Daniel Trstenjak) Date: Mon, 15 Dec 2014 18:26:17 +0100 Subject: [Haskell-cafe] managing local cabal package database In-Reply-To: References: <20141215090009.GA18274@machine> Message-ID: <20141215172617.GA332@machine> Hi Carl, > The solution, of course, is versioning, but I think 'add-source' > doesn't help there anymore (right?), unless I copy the head to another > directory and do the improvements there. Assuming you have a git/svn/whatever repository for package X, then I would most likely create a version 0.1 branch of package X and let project A depend on version 0.1, and in the same way have a version 0.2 branch for project B. This way you can't use the wrong branch of package X without cabal yelling at you, that the desired version isn't available. Yes, you would have two checkouts of package X, each one switched two the desired version. Otherwise having your own Hackage server seems to be the only way to have an automatic version resolution. Greetings, Daniel From danburton.email at gmail.com Mon Dec 15 19:24:09 2014 From: danburton.email at gmail.com (Dan Burton) Date: Mon, 15 Dec 2014 11:24:09 -0800 Subject: [Haskell-cafe] PVP question In-Reply-To: <548F1600.4030700@ro-che.info> References: <548F1600.4030700@ro-che.info> Message-ID: In other words, the PVP is not rigorously specified, and this particular question is uncharted territory. My initial interpretation of the PVP is one of subtyping. I consider loosening type signatures as a minor version bump, because the new thing still fits into holes shaped like the old thing. However, seen a different way, you could say that previously, IO () was just a value, but now, it's (forall a. IO a), which is basically (a:Type -> IO a), if Haskell were dependently typed. Going from a value to a function is definitely a major change. Was that sufficiently unhelpful? :P I think my conclusion is perhaps that the PVP should remain undefined on this particular question, since I see no obvious answer. Or, since the PVP already encourages a cautious over-estimate of what constitutes a breaking change, perhaps we should go with this fallback: "when in doubt, call it a major change." -- Dan Burton On Mon, Dec 15, 2014 at 9:10 AM, Roman Cheplyaka wrote: > > Almost any API change can break existing code. > > For example, adding a new function can break code. > > I thought the guiding principle for PVP was how likely it is that a > piece of client code will break, not if that's theoretically possible. > > On 15/12/14 11:44, Johan Tibell wrote: > > I think the question is: can this change cause existing code to stop > > compiling (perhaps assuming people aren't using -Werror)? I don't think > > it can but perhaps generalizing the type could make type inference fail > > somewhere due to an ambiguous type. > > > > We really need a PVP guide that just lists lots of examples, each with a > > note of what kind of change it is (i.e. major, minor, or patch). > > > > On Mon, Dec 15, 2014 at 10:00 AM, Michael Snoyman > > wrote: > > > > I'm a little bit uncertain of the PVP guidelines in a certain > > case[1], so I'd like to get some guidance/clarity. Suppose I have a > > library which provides the function: > > > > myFunction :: IO () > > myFunction = forever $ putStrLn "Still here" >> threadDelay 10^6 > > > > Later, I realize (or someone points out to me) that I've > > over-specified the type signature, and really myFunction should be: > > > > myFunction :: IO a > > > > In this case, does the PVP specify that we should have a minor or a > > major version bump? I'm not certain if this counts as a breaking > > change or not. > > > > [1] https://github.com/fpco/streaming-commons/pull/13 > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tdammers at gmail.com Mon Dec 15 19:32:20 2014 From: tdammers at gmail.com (Tobias Dammers) Date: Mon, 15 Dec 2014 20:32:20 +0100 Subject: [Haskell-cafe] Ordered JSON objects? Message-ID: <20141215193220.GA15214@yemaya> I'm building a "thing" that is supposed to use JSON 'documents' as its building blocks, providing various (pluggable) storage backends and presentation frontends. Non-techie/semi-techie (frontend dev, web dev, etc.) compatibility is needed, which is why I want to keep the data model "simple" and dynamically typed. Anyway, one thing I'm running up against is that I am going to need ordered key/value collections, which I believe is something JSON does not support out-of-the-box: "objects" ({"foo":15, "bar":23}) are conceptually unordered key/value collections (and Aeson treats them as such, using hash maps as the intermediate storage format), so I lose ordering; OTOH, flat lists ([15, 23]) do not have keys, and lists of "pairs" (two-element lists) produce uglier syntax ([["foo",15], ["bar",23]]), but they are the "correct" solution. Ideally, someone is going to step up and tell me that both I and Aeson have misunderstood JSON, and objects are really supposed to be ordered after all, in which case I'd need an alternative to Aeson (or someone needs to patch it?). Or I could bite the bullet and go with [["foo",15], ["bar",23]]. Or I could ditch JSON as the canonical format and go with something custom, or, shudder, XML. Thoughts? Hints? Ideas? - Tobias (tdammers on freenode) From spam at scientician.net Mon Dec 15 19:39:31 2014 From: spam at scientician.net (Bardur Arantsson) Date: Mon, 15 Dec 2014 20:39:31 +0100 Subject: [Haskell-cafe] PVP question In-Reply-To: References: <548F1600.4030700@ro-che.info> Message-ID: On 2014-12-15 20:24, Dan Burton wrote: > Was that sufficiently unhelpful? :P I think my conclusion is perhaps that > the PVP should remain undefined on this particular question, since I see no > obvious answer. Or, since the PVP already encourages a cautious > over-estimate of what constitutes a breaking change, perhaps we should go > with this fallback: "when in doubt, call it a major change." I'd add that the level of caution should definitely also be a function of the number of (published) reverse dependencies that the package in question has. (I wouldn't be too worried about unpublished reverse dependencies; if you keep your code hidden from the world, it's *your* problem to deal with breakage that cannot be foreseen by the authors of your dependencies.) Regards, From steve at fenestra.com Mon Dec 15 19:54:37 2014 From: steve at fenestra.com (Steve Schafer) Date: Mon, 15 Dec 2014 14:54:37 -0500 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <20141215193220.GA15214@yemaya> References: <20141215193220.GA15214@yemaya> Message-ID: <6qeu8a9kurcr927dngsepjpaj7v3dlpmgu@4ax.com> On Mon, 15 Dec 2014 20:32:20 +0100, you wrote: >Anyway, one thing I'm running up against is that I am going to need >ordered key/value collections, which I believe is something JSON does >not support out-of-the-box: "objects" ({"foo":15, "bar":23}) are >conceptually unordered key/value collections (and Aeson treats them as >such, using hash maps as the intermediate storage format), so I lose >ordering; OTOH, flat lists ([15, 23]) do not have keys, and lists of >"pairs" (two-element lists) produce uglier syntax ([["foo",15], >["bar",23]]), but they are the "correct" solution. I think this: [{"foo":15}, {"bar":23}] makes more sense than this: [["foo", 15], ["bar", 23]] as it maintains the key vs. value distinction. But you are correct that in JSON, arrays are ordered but objects are not. -Steve Schafer From hesselink at gmail.com Mon Dec 15 20:28:44 2014 From: hesselink at gmail.com (Erik Hesselink) Date: Mon, 15 Dec 2014 21:28:44 +0100 Subject: [Haskell-cafe] PVP question In-Reply-To: <548F1600.4030700@ro-che.info> References: <548F1600.4030700@ro-che.info> Message-ID: I've always understood the PVP to be meant to prevent (almost?) all breakage, provided you follow the right relation between your imports and dependency version ranges: * If you depend on a range of minor versions (x.y.*), you should use only qualified or explicit imports. * If you depend on a range of bugfix versions (x.y.z.*), you can use implicit imports. That is why adding a function is a minor version bump, and not a bugfix: it can break people using implicit imports. In this case, theoretically you could break people's code, if it is something like this: f = myFunction >>= print However, since the return type is (), I doubt anyone is doing this, and I'd go for the pragmatic approach and make this change in a minor (or even bugfix) version. Erik On Mon, Dec 15, 2014 at 6:10 PM, Roman Cheplyaka wrote: > Almost any API change can break existing code. > > For example, adding a new function can break code. > > I thought the guiding principle for PVP was how likely it is that a > piece of client code will break, not if that's theoretically possible. > > On 15/12/14 11:44, Johan Tibell wrote: >> I think the question is: can this change cause existing code to stop >> compiling (perhaps assuming people aren't using -Werror)? I don't think >> it can but perhaps generalizing the type could make type inference fail >> somewhere due to an ambiguous type. >> >> We really need a PVP guide that just lists lots of examples, each with a >> note of what kind of change it is (i.e. major, minor, or patch). >> >> On Mon, Dec 15, 2014 at 10:00 AM, Michael Snoyman > > wrote: >> >> I'm a little bit uncertain of the PVP guidelines in a certain >> case[1], so I'd like to get some guidance/clarity. Suppose I have a >> library which provides the function: >> >> myFunction :: IO () >> myFunction = forever $ putStrLn "Still here" >> threadDelay 10^6 >> >> Later, I realize (or someone points out to me) that I've >> over-specified the type signature, and really myFunction should be: >> >> myFunction :: IO a >> >> In this case, does the PVP specify that we should have a minor or a >> major version bump? I'm not certain if this counts as a breaking >> change or not. >> >> [1] https://github.com/fpco/streaming-commons/pull/13 > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From targen at gmail.com Mon Dec 15 21:45:55 2014 From: targen at gmail.com (=?UTF-8?Q?Manuel_G=C3=B3mez?=) Date: Mon, 15 Dec 2014 17:15:55 -0430 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <20141215193220.GA15214@yemaya> References: <20141215193220.GA15214@yemaya> Message-ID: On Mon, Dec 15, 2014 at 3:02 PM, Tobias Dammers wrote: > Anyway, one thing I'm running up against is that I am going to need > ordered key/value collections, which I believe is something JSON does > not support out-of-the-box: "objects" ({"foo":15, "bar":23}) are > conceptually unordered key/value collections (and Aeson treats them as > such, using hash maps as the intermediate storage format) This only works for pretty-printing unordered key/value collections with a consistent, value-independent ordering, so it doesn?t sound like it solves your problem, but it may be worth mentioning anyway: http://hackage.haskell.org/package/aeson-pretty-0.7.2/docs/Data-Aeson-Encode-Pretty.html#g:3 From wojtek at power.com.pl Mon Dec 15 22:01:12 2014 From: wojtek at power.com.pl (=?UTF-8?B?V29qdGVrIE5hcmN6ecWEc2tp?=) Date: Mon, 15 Dec 2014 23:01:12 +0100 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <20141215193220.GA15214@yemaya> References: <20141215193220.GA15214@yemaya> Message-ID: <548F5A28.40802@power.com.pl> On 15.12.2014 20:32, Tobias Dammers wrote: > Anyway, one thing I'm running up against is that I am going to need > ordered key/value collections, which I believe is something JSON does > not support out-of-the-box: "objects" ({"foo":15, "bar":23}) are > conceptually unordered key/value collections (and Aeson treats them as > such, using hash maps as the intermediate storage format), so I lose > ordering; JSON does not forbid ordering of maps by key, I believe. But you'd need to create an OrderedMap and patch aeson. It would be very useful, the mixing of key order is nuisance for human JSON consumers. From johan.tibell at gmail.com Mon Dec 15 22:31:15 2014 From: johan.tibell at gmail.com (Johan Tibell) Date: Mon, 15 Dec 2014 23:31:15 +0100 Subject: [Haskell-cafe] PVP question In-Reply-To: <548F1600.4030700@ro-che.info> References: <548F1600.4030700@ro-che.info> Message-ID: The PVP is more specific than this and allows you to communicate how the API changes and what downstream packages can depend on. From the PVP: > 2. Otherwise, if only new bindings, types, classes, non-orphan instances or modules (but see below) were added to the interface, then A.B may remain the same but the new C must be greater than the old C. Note that modifying imports or depending on a newer version of another package may cause extra non-orphan instances to be exported and thus force a minor version change. So it's clear that adding a function requires a minor version bumps and it's also what that means for downstream packages: > Often a package maintainer wants to add to an API without breaking backwards compatibility, and in that case they can follow the rules of point 2, and increase only C. A client can specify that they are insensitive to additions to the API by allowing a range of C values, e.g. build-depends: base >= 2.1.1 && < 2.2. ("insensitive to additions to the API" links to https://www.haskell.org/haskellwiki/Import_modules_properly.) So yes, if you use open imports and allow new minor versions, your code might break. This is expected. What's not clear here is that this rule might a bit stricter than necessary: > 1. If any entity was removed, or the types of any entities or the definitions of datatypes or classes were changed, or orphan instances were added or any instances were removed, then the new A.B must be greater than the previous A.B. Note that modifying imports or depending on a newer version of another package may cause extra orphan instances to be exported and thus force a major version change. According to this rule Michael's change requires a major version bump. However, there might be backwards compatible type changes that could be covered under rule 2 which are not. Whether Michael's change is such a type change is what we're trying to figure out in this thread. -- Johan On Mon, Dec 15, 2014 at 6:10 PM, Roman Cheplyaka wrote: > > Almost any API change can break existing code. > > For example, adding a new function can break code. > > I thought the guiding principle for PVP was how likely it is that a > piece of client code will break, not if that's theoretically possible. > > On 15/12/14 11:44, Johan Tibell wrote: > > I think the question is: can this change cause existing code to stop > > compiling (perhaps assuming people aren't using -Werror)? I don't think > > it can but perhaps generalizing the type could make type inference fail > > somewhere due to an ambiguous type. > > > > We really need a PVP guide that just lists lots of examples, each with a > > note of what kind of change it is (i.e. major, minor, or patch). > > > > On Mon, Dec 15, 2014 at 10:00 AM, Michael Snoyman > > wrote: > > > > I'm a little bit uncertain of the PVP guidelines in a certain > > case[1], so I'd like to get some guidance/clarity. Suppose I have a > > library which provides the function: > > > > myFunction :: IO () > > myFunction = forever $ putStrLn "Still here" >> threadDelay 10^6 > > > > Later, I realize (or someone points out to me) that I've > > over-specified the type signature, and really myFunction should be: > > > > myFunction :: IO a > > > > In this case, does the PVP specify that we should have a minor or a > > major version bump? I'm not certain if this counts as a breaking > > change or not. > > > > [1] https://github.com/fpco/streaming-commons/pull/13 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Mon Dec 15 22:34:09 2014 From: johan.tibell at gmail.com (Johan Tibell) Date: Mon, 15 Dec 2014 23:34:09 +0100 Subject: [Haskell-cafe] PVP question In-Reply-To: References: <548F1600.4030700@ro-che.info> Message-ID: On Mon, Dec 15, 2014 at 8:24 PM, Dan Burton wrote: > > Or, since the PVP already encourages a cautious over-estimate of what > constitutes a breaking change, perhaps we should go with this fallback: > "when in doubt, call it a major change." > I think this makes sense. Unless you can convince yourself that the change doesn't break backwards compatibility (i.e. doesn't break code that uses only qualified imports and/or explicit import lists) bump the major version number. We should take the guesswork out of this. We should enumerate all possible API change variations and the corresponding version number bump. Even better, we should have a tool (like Elm has) that does so for you. > > -- Dan Burton > > On Mon, Dec 15, 2014 at 9:10 AM, Roman Cheplyaka wrote: > >> Almost any API change can break existing code. >> >> For example, adding a new function can break code. >> >> I thought the guiding principle for PVP was how likely it is that a >> piece of client code will break, not if that's theoretically possible. >> >> On 15/12/14 11:44, Johan Tibell wrote: >> > I think the question is: can this change cause existing code to stop >> > compiling (perhaps assuming people aren't using -Werror)? I don't think >> > it can but perhaps generalizing the type could make type inference fail >> > somewhere due to an ambiguous type. >> > >> > We really need a PVP guide that just lists lots of examples, each with a >> > note of what kind of change it is (i.e. major, minor, or patch). >> > >> > On Mon, Dec 15, 2014 at 10:00 AM, Michael Snoyman > > > wrote: >> > >> > I'm a little bit uncertain of the PVP guidelines in a certain >> > case[1], so I'd like to get some guidance/clarity. Suppose I have a >> > library which provides the function: >> > >> > myFunction :: IO () >> > myFunction = forever $ putStrLn "Still here" >> threadDelay 10^6 >> > >> > Later, I realize (or someone points out to me) that I've >> > over-specified the type signature, and really myFunction should be: >> > >> > myFunction :: IO a >> > >> > In this case, does the PVP specify that we should have a minor or a >> > major version bump? I'm not certain if this counts as a breaking >> > change or not. >> > >> > [1] https://github.com/fpco/streaming-commons/pull/13 >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roma at ro-che.info Mon Dec 15 22:39:45 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Tue, 16 Dec 2014 00:39:45 +0200 Subject: [Haskell-cafe] PVP question In-Reply-To: References: <548F1600.4030700@ro-che.info> Message-ID: <548F6331.8050502@ro-che.info> On 16/12/14 00:31, Johan Tibell wrote: > So yes, if you use open imports and allow new minor versions, your code > might break. This is expected. One similarly could argue that "if you use functions in polymorphic contexts and allow new minor versions, your code might break". This isn't in the PVP, but it's exactly in the same spirit, IMO. Roman From zach.moazeni at gmail.com Tue Dec 16 01:42:48 2014 From: zach.moazeni at gmail.com (Zach Moazeni) Date: Mon, 15 Dec 2014 20:42:48 -0500 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions Message-ID: Hello, Forgive me if this is a frequently asked question, I've searched the web and can't find an answer. I originally sent this to the Beginners list and someone said this might get more responses here instead. What is the history that led up to the PVP specifying two values as the major version? I come from other tools that primarily use http://semver.org/ (or a variant) and I'm confused in what cases I should bump "A" but not "B" (or bump "B" but not "A")? A concrete example: If I make backwards incompatible changes to a package whose latest version is 1.0.x, should the next version be 2.0.x or 1.1.x? What sorts of things should I consider for choosing 2.0 over 1.1 and vice versa? Another question, by far most packages I have encountered either lead with a 0 or a 1 for "A". Does that have some bearing on the long term stability that package users should expect in the future? Finally, if "1.0.x.." is meant to convey a level of long term support, does "B" get rarely used? Since "C" version bumps to include backwards compatible additions, and "D"+ for backwards compatible bug fixes. (I know "D" isn't technically a PVP category, I'm just relating it to the patch version of semver). Thanks for your help! -Zach -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidleothomas at gmail.com Tue Dec 16 01:46:18 2014 From: davidleothomas at gmail.com (David Thomas) Date: Mon, 15 Dec 2014 17:46:18 -0800 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: References: Message-ID: To my mind, bump A if it's a big change that's going to require a lot of work tracking it; B if it's a small change that can probably be upgraded to fairly simply. On Mon, Dec 15, 2014 at 5:42 PM, Zach Moazeni wrote: > Hello, > > Forgive me if this is a frequently asked question, I've searched the web and > can't find an answer. I originally sent this to the Beginners list and > someone said this might get more responses here instead. > > What is the history that led up to the PVP specifying two values as the > major version? > > I come from other tools that primarily use http://semver.org/ (or a variant) > and I'm confused in what cases I should bump "A" but not "B" (or bump "B" > but not "A")? > > A concrete example: If I make backwards incompatible changes to a package > whose latest version is 1.0.x, should the next version be 2.0.x or 1.1.x? > What sorts of things should I consider for choosing 2.0 over 1.1 and vice > versa? > > > Another question, by far most packages I have encountered either lead with a > 0 or a 1 for "A". Does that have some bearing on the long term stability > that package users should expect in the future? > > Finally, if "1.0.x.." is meant to convey a level of long term support, does > "B" get rarely used? Since "C" version bumps to include backwards compatible > additions, and "D"+ for backwards compatible bug fixes. (I know "D" isn't > technically a PVP category, I'm just relating it to the patch version of > semver). > > Thanks for your help! > > -Zach > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From allbery.b at gmail.com Tue Dec 16 01:49:30 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 15 Dec 2014 20:49:30 -0500 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: References: Message-ID: On Mon, Dec 15, 2014 at 8:42 PM, Zach Moazeni wrote: > > Forgive me if this is a frequently asked question, I've searched the web > and can't find an answer. I originally sent this to the Beginners list and > someone said this might get more responses here instead. > > What is the history that led up to the PVP > > > specifying two values as the major version? > One clue might be that that is how GHC itself is versioned. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From tikhon at jelv.is Tue Dec 16 01:53:21 2014 From: tikhon at jelv.is (Tikhon Jelvis) Date: Mon, 15 Dec 2014 17:53:21 -0800 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: References: Message-ID: I think lens[1] is a good example of a package that uses both major numbers effectively. The second number is bumped each time there is a backwards-incompatible change, and the first number is bumped each time there is a *major* organizational change in the library. (It's up to 4 now.) To me, this approach makes sense because not all breaking changes are the same. Sometimes you just want to tweak a single call for whatever reason (maybe security), and sometimes you want to reogranize the whole package, move around major modules... etc. Putting both kinds of changes behind the same version number seems a bit awkward. [1]: https://hackage.haskell.org/package/lens On Mon, Dec 15, 2014 at 5:49 PM, Brandon Allbery wrote: > > On Mon, Dec 15, 2014 at 8:42 PM, Zach Moazeni > wrote: >> >> Forgive me if this is a frequently asked question, I've searched the web >> and can't find an answer. I originally sent this to the Beginners list and >> someone said this might get more responses here instead. >> >> What is the history that led up to the PVP >> >> >> specifying two values as the major version? >> > > One clue might be that that is how GHC itself is versioned. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at bergmark.nl Tue Dec 16 01:58:10 2014 From: adam at bergmark.nl (Adam Bergmark) Date: Tue, 16 Dec 2014 02:58:10 +0100 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: References: Message-ID: On Tue, Dec 16, 2014 at 2:42 AM, Zach Moazeni wrote: > > Hello, > > Forgive me if this is a frequently asked question, I've searched the web > and can't find an answer. I originally sent this to the Beginners list and > someone said this might get more responses here instead. > > What is the history that led up to the PVP > > specifying two values as the major version? > > I come from other tools that primarily use http://semver.org/ (or a > variant) and I'm confused in what cases I should bump "A" but not "B" (or > bump "B" but not "A")? > > A concrete example: If I make backwards incompatible changes to a package > whose latest version is 1.0.x, should the next version be 2.0.x or 1.1.x? > What sorts of things should I consider for choosing 2.0 over 1.1 and vice > versa? > > Both are allowed, it's up to you and there is no explicit rule to decide. Some people seem to be bumping A for big changes, or to signify that the package is now stable. > Another question, by far most packages I have encountered either lead with > a 0 or a 1 for "A". Does that have some bearing on the long term stability > that package users should expect in the future? > Formally, no. But some people use it like that. > > Finally, if "1.0.x.." is meant to convey a level of long term support, > does "B" get rarely used? Since "C" version bumps to include backwards > compatible additions, and "D"+ for backwards compatible bug fixes. (I know > "D" isn't technically a PVP category, I'm just relating it to the patch > version of semver). > > Thanks for your help! > > -Zach > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From acfoltzer at gmail.com Tue Dec 16 02:11:04 2014 From: acfoltzer at gmail.com (Adam Foltzer) Date: Mon, 15 Dec 2014 18:11:04 -0800 Subject: [Haskell-cafe] Year-end deadline for Haskell.org donations In-Reply-To: References: Message-ID: Hi Pedro, Thanks for taking the time to check out the donation page, and for raising these questions. Haskell.org is an associated project of Software in the Public Interest (SPI), which allows donations to be tax-exempt in many jurisdictions. Unfortunately that means the form of the donation page is out of our control (we've previously tried unsuccessfully to get them to accept other forms of payment such as PayPal and BitPay). I can say that I've used clickandpledge several times without problems, but that doesn't make the page look any better. I'd recommend checking out the donations page for Software in the Public interest for more information on their donation methods [1]. There is another online credit card processor, but the security situation on that page appears to be worse than the clickandpledge page (RC4!). There is an alternative that allows PayPal (be sure to add a designation of "Haskell.org"), but I have not personally tried this option [2]. We'll work to put more pressure on SPI to improve their payment options. After all, anything deterring folks from donating is bad for all of the projects they support. Let me know how else I can help, and thanks again for the report. Adam [1]: http://www.spi-inc.org/donations/ [2]: https://www.networkforgood.org/donation/ExpressDonation.aspx?ORGID2=11-3390208&vlrStratCode=z1Ll0BVsKIzXBEdPqkqnXmofB8tJH%2b6meSF7xCrQC90MO9COSWm0Ki1KbRHhwmUT On Mon, Dec 15, 2014 at 2:46 AM, Jos? Pedro Magalh?es wrote: > > I'd like to donate, but I must say I feel slightly doubtful about the donation page (see screenshot). The URL or the page text doesn't really mention Haskell or any details about the donation, the certificate doesn't seem to have Extended Validation, the labels for the steps 1..5 are missing, the T&C is empty... all in all, it doesn't look like a page where I want to enter my credit card details. > > So, I guess I have two questions: > > 1) Is this really safe, and will my money go to haskell.org? > 2) Can't we come up with a more trustworthy-looking donation website? > > > Thanks, > Pedro > > > On Fri, Dec 12, 2014 at 9:58 PM, Adam Foltzer wrote: >> >> Dear Haskellers, >> >> HaskellWiki, Hackage, Hoogle, and all the other Haskell.org sites we depend on are hosted with funds donated by you, the Haskell community. As many of us are in tax jurisdictions where December 31st is a deadline for charitable giving, I?d like to remind you that donations to support these activities are tax-deductible. You can donate online right now at https://co.clickandpledge.com/advanced/default.aspx?wid=69561. >> >> Last year was the first time we were able to seek your help while offering tax relief, and you came through: we raised nearly $900 in the span of a few days! This year, with almost three weeks left before the end of the year, I'd love to see us double that. >> >> It has been quite a year for Haskell.org: we migrated of most of our infrastructure, including Hackage, to Rackspace in order to improve reliability. We implemented new proxying to improve speed and performance, and improved the documentation and standardization of our server administration practices. Many of these accomplishments and much else are detailed by Austin Seipp at the new Haskell.org infrastructure blog at https://blog.haskell.org/post/the_new_haskell_org/. Let's keep the momentum going in 2015! >> >> Thank you and best wishes for a happy new year, >> Adam Foltzer & The Haskell.org Committee >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From austin at well-typed.com Tue Dec 16 08:09:45 2014 From: austin at well-typed.com (Austin Seipp) Date: Tue, 16 Dec 2014 02:09:45 -0600 Subject: [Haskell-cafe] Year-end deadline for Haskell.org donations In-Reply-To: References: Message-ID: Hi, Just a note, Click & Pledge actually does have an online API and forms solution we could use. In the interest of making end-users feel more comfortable, it would probably be worth setting up our own donation form, on-site, and directing people there to make donations. I can understand the hesitation when the donation page looks retro and has a few bugs, is off site, and not controlled directly by us. And then, hopefully in the future we can extend this support to other payment processors (e.g. such as Stripe), which would allow further donation methods (such as Bitcoin). Having our own donation form would make any transitional process like this, or adding new payment methods, much easier. On Mon, Dec 15, 2014 at 8:11 PM, Adam Foltzer wrote: > Hi Pedro, > > Thanks for taking the time to check out the donation page, and for raising > these questions. Haskell.org is an associated project of Software in the > Public Interest (SPI), which allows donations to be tax-exempt in many > jurisdictions. Unfortunately that means the form of the donation page is out > of our control (we've previously tried unsuccessfully to get them to accept > other forms of payment such as PayPal and BitPay). I can say that I've used > clickandpledge several times without problems, but that doesn't make the > page look any better. > > I'd recommend checking out the donations page for Software in the Public > interest for more information on their donation methods [1]. There is > another online credit card processor, but the security situation on that > page appears to be worse than the clickandpledge page (RC4!). There is an > alternative that allows PayPal (be sure to add a designation of > "Haskell.org"), but I have not personally tried this option [2]. > > We'll work to put more pressure on SPI to improve their payment options. > After all, anything deterring folks from donating is bad for all of the > projects they support. > > Let me know how else I can help, and thanks again for the report. > > Adam > > [1]: http://www.spi-inc.org/donations/ > [2]: > https://www.networkforgood.org/donation/ExpressDonation.aspx?ORGID2=11-3390208&vlrStratCode=z1Ll0BVsKIzXBEdPqkqnXmofB8tJH%2b6meSF7xCrQC90MO9COSWm0Ki1KbRHhwmUT > > > On Mon, Dec 15, 2014 at 2:46 AM, Jos? Pedro Magalh?es > wrote: >> >> I'd like to donate, but I must say I feel slightly doubtful about the >> donation page (see screenshot). The URL or the page text doesn't really >> mention Haskell or any details about the donation, the certificate doesn't >> seem to have Extended Validation, the labels for the steps 1..5 are missing, >> the T&C is empty... all in all, it doesn't look like a page where I want to >> enter my credit card details. >> >> So, I guess I have two questions: >> >> 1) Is this really safe, and will my money go to haskell.org? >> 2) Can't we come up with a more trustworthy-looking donation website? >> >> >> Thanks, >> Pedro >> >> >> On Fri, Dec 12, 2014 at 9:58 PM, Adam Foltzer wrote: >>> >>> Dear Haskellers, >>> >>> HaskellWiki, Hackage, Hoogle, and all the other Haskell.org sites we >>> depend on are hosted with funds donated by you, the Haskell community. As >>> many of us are in tax jurisdictions where December 31st is a deadline for >>> charitable giving, I?d like to remind you that donations to support these >>> activities are tax-deductible. You can donate online right now at >>> https://co.clickandpledge.com/advanced/default.aspx?wid=69561. >>> >>> Last year was the first time we were able to seek your help while >>> offering tax relief, and you came through: we raised nearly $900 in the span >>> of a few days! This year, with almost three weeks left before the end of the >>> year, I'd love to see us double that. >>> >>> It has been quite a year for Haskell.org: we migrated of most of our >>> infrastructure, including Hackage, to Rackspace in order to improve >>> reliability. We implemented new proxying to improve speed and performance, >>> and improved the documentation and standardization of our server >>> administration practices. Many of these accomplishments and much else are >>> detailed by Austin Seipp at the new Haskell.org infrastructure blog at >>> https://blog.haskell.org/post/the_new_haskell_org/. Let's keep the momentum >>> going in 2015! >>> >>> Thank you and best wishes for a happy new year, >>> Adam Foltzer & The Haskell.org Committee >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Regards, Austin Seipp, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/ From tdammers at gmail.com Tue Dec 16 08:39:11 2014 From: tdammers at gmail.com (Tobias Dammers) Date: Tue, 16 Dec 2014 09:39:11 +0100 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <548F5A28.40802@power.com.pl> References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> Message-ID: <20141216083910.GA28609@nibbler> On Mon, Dec 15, 2014 at 11:01:12PM +0100, Wojtek Narczy?ski wrote: > On 15.12.2014 20:32, Tobias Dammers wrote: > > >Anyway, one thing I'm running up against is that I am going to need > >ordered key/value collections, which I believe is something JSON does > >not support out-of-the-box: "objects" ({"foo":15, "bar":23}) are > >conceptually unordered key/value collections (and Aeson treats them as > >such, using hash maps as the intermediate storage format), so I lose > >ordering; > > JSON does not forbid ordering of maps by key, I believe. But you'd need to > create an OrderedMap and patch aeson. It would be very useful, the mixing of > key order is nuisance for human JSON consumers. No, that's not what I meant. By "ordered", I meant that the in-memory representation of the document should maintain file order. Aeson uses a HashMap to store key/value objects, which is an unordered container; what you suggest would be something like Map (storing elements by key order), but what I'm talking about is more like [(Key, Value)], i.e., keeping file order intact. From giacomo at tesio.it Tue Dec 16 08:41:28 2014 From: giacomo at tesio.it (Giacomo Tesio) Date: Tue, 16 Dec 2014 09:41:28 +0100 Subject: [Haskell-cafe] Haskell Polishing [was: Missing `$` like operators in Haskell] Message-ID: 2014-12-12 14:22 GMT+01:00 Johan Tibell : > > Everything doesn't have to have an operator! We use operators a bit too > much. It hurts readability of code when lines start looking like APL. > > Probably this has been discussed already (and I'd like to read previous material, btw, so please give me some reference), but as a long time programmer with experience in many different paradigms and languages I too feel Haskell a bit cumbersome from this point of view. I mean, the language in itself is the best I know, but libraries have different levels of quality and in general they miss organization: they often overlap in intent and interface, for example. Anyone tried to address this issue? And if so, how? I can see how backward compatibility prevents Haskell to be polished, but it's a pity. It's like an handbrake for it's evolution and adoption! Giacomo -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at snoyman.com Tue Dec 16 08:43:08 2014 From: michael at snoyman.com (Michael Snoyman) Date: Tue, 16 Dec 2014 08:43:08 +0000 Subject: [Haskell-cafe] Ordered JSON objects? References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> Message-ID: On Tue Dec 16 2014 at 10:39:32 AM Tobias Dammers wrote: > On Mon, Dec 15, 2014 at 11:01:12PM +0100, Wojtek Narczy?ski wrote: > > On 15.12.2014 20:32, Tobias Dammers wrote: > > > > >Anyway, one thing I'm running up against is that I am going to need > > >ordered key/value collections, which I believe is something JSON does > > >not support out-of-the-box: "objects" ({"foo":15, "bar":23}) are > > >conceptually unordered key/value collections (and Aeson treats them as > > >such, using hash maps as the intermediate storage format), so I lose > > >ordering; > > > > JSON does not forbid ordering of maps by key, I believe. But you'd need > to > > create an OrderedMap and patch aeson. It would be very useful, the > mixing of > > key order is nuisance for human JSON consumers. > > No, that's not what I meant. By "ordered", I meant that the in-memory > representation of the document should maintain file order. Aeson uses a > HashMap to store key/value objects, which is an unordered container; > what you suggest would be something like Map (storing elements by key > order), but what I'm talking about is more like [(Key, Value)], i.e., > keeping file order intact. > > I think your best bet is to bite the bullet and just deal with an array, forgetting the object entirely (at least at the top level). Any time I've needed to implement some kind of ordered data in JSON, I've used an array. Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From tdammers at gmail.com Tue Dec 16 09:10:21 2014 From: tdammers at gmail.com (Tobias Dammers) Date: Tue, 16 Dec 2014 10:10:21 +0100 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> Message-ID: <20141216091019.GC28609@nibbler> On Tue, Dec 16, 2014 at 08:43:08AM +0000, Michael Snoyman wrote: > On Tue Dec 16 2014 at 10:39:32 AM Tobias Dammers wrote: > > > On Mon, Dec 15, 2014 at 11:01:12PM +0100, Wojtek Narczy?ski wrote: > > > On 15.12.2014 20:32, Tobias Dammers wrote: > > > > > > >Anyway, one thing I'm running up against is that I am going to need > > > >ordered key/value collections, which I believe is something JSON does > > > >not support out-of-the-box: "objects" ({"foo":15, "bar":23}) are > > > >conceptually unordered key/value collections (and Aeson treats them as > > > >such, using hash maps as the intermediate storage format), so I lose > > > >ordering; > > > > > > JSON does not forbid ordering of maps by key, I believe. But you'd need > > to > > > create an OrderedMap and patch aeson. It would be very useful, the > > mixing of > > > key order is nuisance for human JSON consumers. > > > > No, that's not what I meant. By "ordered", I meant that the in-memory > > representation of the document should maintain file order. Aeson uses a > > HashMap to store key/value objects, which is an unordered container; > > what you suggest would be something like Map (storing elements by key > > order), but what I'm talking about is more like [(Key, Value)], i.e., > > keeping file order intact. > > > > > I think your best bet is to bite the bullet and just deal with an array, > forgetting the object entirely (at least at the top level). Any time I've > needed to implement some kind of ordered data in JSON, I've used an array. Yes, that's what I was thinking myself. I absolutely don't want to use "looks like JSON but isn't", I really want to stick with standard JSON, for so many reasons. My tentative design so far is to use an array of "anything"; each element can be a scalar (which generates an unnamed field), an object with the magic properties "_name" and "_value", which generates a named field, or something else, which generates an unnamed field containing that something else. So I'd have this: [ "foobar" , { "baz": "quux", "boink": "blip" } , { "_name": "foobar", "_value": "oink" } , { "_name": "quuux", "_value": { "apples": "oranges" } } ] ...which would map to something like (in pseudo-Show notation): [ ("_field_1", String "foobar") , ("_field_2", Object (fromList [ ("baz", "quux"), ("boink", "blip") ])) , ("foobar", String "boink") , ("quuux", Object (fromList [ ("apples": "oranges") ])) ] This would meet the requirement of providing ordered properties, and it would allow for arbitrary JSON (i.e., the mapping would be total over all valid JSON arrays); the downside is that the ToJSON and FromJSON instances for my Record type would be a bit more complex than what I have now, but I guess that would be OK. Another downside would be that if an element specifies both "_value" *and* non-magic fields, I would have to decide whether I want to treat "_value" as non-magic, or throw away the non-magical fields. From tdammers at gmail.com Tue Dec 16 09:18:26 2014 From: tdammers at gmail.com (Tobias Dammers) Date: Tue, 16 Dec 2014 10:18:26 +0100 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: References: Message-ID: <20141216091824.GD28609@nibbler> IIRC, the rules (for libraries at least) are (correct me if I'm wrong): - When you introduce a new entity in the public interface, such as a new typeclass, a new exported type, a new exported function, etc., you should bump the *second* number. This is because such introductions are only breaking changes when the consumer imports your modules unqualified and completely (i.e. `import The.Module`, not `import qualified The.Module as TM` nor `import The.Module (foo, bar)`). Importing your module "safely" will not break anything because the previous entities are still there, and the new ones simply won't be imported, so they cannot cause any clashes. - When you change the signature of an existing public entity, you should bump the first number, because this is a potential breaking change even with "safe" imports. - When you remove an existing public entity, or an entire module, or rename either, you should also bump the first number, for the same reasons. And then on the consumer side, this means you can decide to either fix your dependencies to just the first version number and import everything "safely" (qualified / per identifier), or to fix them to 2-part version numbers and use "dangerous" imports. >From my experience, however, this is neither watertight nor something everyone follows religiously, so in practice it isn't all that useful after all. Part of the problem is probably that there are no tools in widespread use that would block a release under a "wrong" version number, although I don't see any reasons why this should be technically impossible to do. On Mon, Dec 15, 2014 at 08:42:48PM -0500, Zach Moazeni wrote: > Hello, > > Forgive me if this is a frequently asked question, I've searched the web > and can't find an answer. I originally sent this to the Beginners list and > someone said this might get more responses here instead. > > What is the history that led up to the PVP > specifying > two values as the major version? > > I come from other tools that primarily use http://semver.org/ (or a > variant) and I'm confused in what cases I should bump "A" but not "B" (or > bump "B" but not "A")? > > A concrete example: If I make backwards incompatible changes to a package > whose latest version is 1.0.x, should the next version be 2.0.x or 1.1.x? > What sorts of things should I consider for choosing 2.0 over 1.1 and vice > versa? > > > Another question, by far most packages I have encountered either lead with > a 0 or a 1 for "A". Does that have some bearing on the long term stability > that package users should expect in the future? > > Finally, if "1.0.x.." is meant to convey a level of long term support, does > "B" get rarely used? Since "C" version bumps to include backwards > compatible additions, and "D"+ for backwards compatible bug fixes. (I know > "D" isn't technically a PVP category, I'm just relating it to the patch > version of semver). > > Thanks for your help! > > -Zach > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tobias Dammers - tobias at twokings.nl - 070-3457628 - www.twokings.nl Maandag t/m donderdag van 9.00 tot 17.30 Voor dringende vragen, mail naar support at twokings.nl From hesselink at gmail.com Tue Dec 16 09:40:15 2014 From: hesselink at gmail.com (Erik Hesselink) Date: Tue, 16 Dec 2014 10:40:15 +0100 Subject: [Haskell-cafe] PVP question In-Reply-To: <548F6331.8050502@ro-che.info> References: <548F1600.4030700@ro-che.info> <548F6331.8050502@ro-che.info> Message-ID: On Mon, Dec 15, 2014 at 11:39 PM, Roman Cheplyaka wrote: > On 16/12/14 00:31, Johan Tibell wrote: >> So yes, if you use open imports and allow new minor versions, your code >> might break. This is expected. > > One similarly could argue that "if you use functions in polymorphic > contexts and allow new minor versions, your code might break". > > This isn't in the PVP, but it's exactly in the same spirit, IMO. I think this is a bad idea, since a "polymorphic context" (even if rigorously defined) is not clear from reading the code, you have to type check it in your head. The import style, on the other hand, is very simple to read and check if it matches the style of dependency version ranges. Erik From roma at ro-che.info Tue Dec 16 09:48:28 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Tue, 16 Dec 2014 11:48:28 +0200 Subject: [Haskell-cafe] PVP question In-Reply-To: References: <548F1600.4030700@ro-che.info> <548F6331.8050502@ro-che.info> Message-ID: <548FFFEC.4090007@ro-che.info> On 16/12/14 11:40, Erik Hesselink wrote: > On Mon, Dec 15, 2014 at 11:39 PM, Roman Cheplyaka wrote: >> On 16/12/14 00:31, Johan Tibell wrote: >>> So yes, if you use open imports and allow new minor versions, your code >>> might break. This is expected. >> >> One similarly could argue that "if you use functions in polymorphic >> contexts and allow new minor versions, your code might break". >> >> This isn't in the PVP, but it's exactly in the same spirit, IMO. > > I think this is a bad idea, since a "polymorphic context" (even if > rigorously defined) is not clear from reading the code, you have to > type check it in your head. The import style, on the other hand, is > very simple to read and check if it matches the style of dependency > version ranges. Ok, this is a fair point. Roman From johan.tibell at gmail.com Tue Dec 16 10:36:09 2014 From: johan.tibell at gmail.com (Johan Tibell) Date: Tue, 16 Dec 2014 11:36:09 +0100 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: References: Message-ID: Hi! On Tue, Dec 16, 2014 at 2:42 AM, Zach Moazeni wrote: > > A concrete example: If I make backwards incompatible changes to a package > whose latest version is 1.0.x, should the next version be 2.0.x or 1.1.x? > What sorts of things should I consider for choosing 2.0 over 1.1 and vice > versa? > Unless you really change the API drastically I recommend bumping the B component. > Another question, by far most packages I have encountered either lead with > a 0 or a 1 for "A". Does that have some bearing on the long term stability > that package users should expect in the future? > This is something that happens a lot in open source, in Haskell or elsewhere. We We programmers are afraid of calling something 1.0, because that somehow means "done", which we never (think we) are. :) Lots of really stable Haskell libraries (e.g. containers) are still on version 0.X. -- Johan -------------- next part -------------- An HTML attachment was scrubbed... URL: From roma at ro-che.info Tue Dec 16 10:49:43 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Tue, 16 Dec 2014 12:49:43 +0200 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: References: Message-ID: <54900E47.6010201@ro-che.info> On 16/12/14 12:36, Johan Tibell wrote: > Hi! > > On Tue, Dec 16, 2014 at 2:42 AM, Zach Moazeni > wrote: > > A concrete example: If I make backwards incompatible changes to a > package whose latest version is 1.0.x, should the next version be > 2.0.x or 1.1.x? What sorts of things should I consider for choosing > 2.0 over 1.1 and vice versa? > > > Unless you really change the API drastically I recommend bumping the B > component. > > > Another question, by far most packages I have encountered either > lead with a 0 or a 1 for "A". Does that have some bearing on the > long term stability that package users should expect in the future? > > > This is something that happens a lot in open source, in Haskell or > elsewhere. We We programmers are afraid of calling something 1.0, > because that somehow means "done", which we never (think we) are. :) > Lots of really stable Haskell libraries (e.g. containers) are still on > version 0.X. Upper bounds contribute to this problem, too. Suppose you've decided that 'containers' is stable enough to be at 1.0. Now all packages need to be updated, because they most probably depend on 'containers < 1' or tighter. We saw something similar with text, people got angry. If a library becomes popular before it reaches 1.0, it probably never will. Roman From hesselink at gmail.com Tue Dec 16 11:00:19 2014 From: hesselink at gmail.com (Erik Hesselink) Date: Tue, 16 Dec 2014 12:00:19 +0100 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: <54900E47.6010201@ro-che.info> References: <54900E47.6010201@ro-che.info> Message-ID: On Tue, Dec 16, 2014 at 11:49 AM, Roman Cheplyaka wrote: > On 16/12/14 12:36, Johan Tibell wrote: >> On Tue, Dec 16, 2014 at 2:42 AM, Zach Moazeni > > wrote: >> Another question, by far most packages I have encountered either >> lead with a 0 or a 1 for "A". Does that have some bearing on the >> long term stability that package users should expect in the future? >> >> >> This is something that happens a lot in open source, in Haskell or >> elsewhere. We We programmers are afraid of calling something 1.0, >> because that somehow means "done", which we never (think we) are. :) >> Lots of really stable Haskell libraries (e.g. containers) are still on >> version 0.X. > > Upper bounds contribute to this problem, too. > > Suppose you've decided that 'containers' is stable enough to be at 1.0. > > Now all packages need to be updated, because they most probably depend > on 'containers < 1' or tighter. > > We saw something similar with text, people got angry. > > If a library becomes popular before it reaches 1.0, it probably never will. I don't understand this. How is bumping 'A' different from bumping 'B'? You could just bump 'A' (to 1, for example) instead of 'B' when you make an API breaking change, and it's no extra effort for people who depend on you. Erik From roma at ro-che.info Tue Dec 16 11:23:20 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Tue, 16 Dec 2014 13:23:20 +0200 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: References: <54900E47.6010201@ro-che.info> Message-ID: <54901628.3070101@ro-che.info> On 16/12/14 13:00, Erik Hesselink wrote: > On Tue, Dec 16, 2014 at 11:49 AM, Roman Cheplyaka wrote: >> On 16/12/14 12:36, Johan Tibell wrote: >>> On Tue, Dec 16, 2014 at 2:42 AM, Zach Moazeni >> > wrote: >>> Another question, by far most packages I have encountered either >>> lead with a 0 or a 1 for "A". Does that have some bearing on the >>> long term stability that package users should expect in the future? >>> >>> >>> This is something that happens a lot in open source, in Haskell or >>> elsewhere. We We programmers are afraid of calling something 1.0, >>> because that somehow means "done", which we never (think we) are. :) >>> Lots of really stable Haskell libraries (e.g. containers) are still on >>> version 0.X. >> >> Upper bounds contribute to this problem, too. >> >> Suppose you've decided that 'containers' is stable enough to be at 1.0. >> >> Now all packages need to be updated, because they most probably depend >> on 'containers < 1' or tighter. >> >> We saw something similar with text, people got angry. >> >> If a library becomes popular before it reaches 1.0, it probably never will. > > I don't understand this. How is bumping 'A' different from bumping > 'B'? You could just bump 'A' (to 1, for example) instead of 'B' when > you make an API breaking change, and it's no extra effort for people > who depend on you. So I need to wait till I have an API-breaking change in order to mark a package as stable? That's... ironic. Also, if the library is stable enough, people would constraint the A version (e.g. 'containers < 1'), asserting that their package will probably continue to build even under minor API-breaking changes which are typical for stable packages. Now, by bumping my A version for a minor breaking change, I'm acting exactly against their intention, saying "hey, this is a massive change, you'd better pay attention before using it". That's not what an actual stable package is supposed to do. Roman From hesselink at gmail.com Tue Dec 16 11:38:07 2014 From: hesselink at gmail.com (Erik Hesselink) Date: Tue, 16 Dec 2014 12:38:07 +0100 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: <54901628.3070101@ro-che.info> References: <54900E47.6010201@ro-che.info> <54901628.3070101@ro-che.info> Message-ID: On Tue, Dec 16, 2014 at 12:23 PM, Roman Cheplyaka wrote: > On 16/12/14 13:00, Erik Hesselink wrote: >> On Tue, Dec 16, 2014 at 11:49 AM, Roman Cheplyaka wrote: >>> On 16/12/14 12:36, Johan Tibell wrote: >>>> On Tue, Dec 16, 2014 at 2:42 AM, Zach Moazeni >>> > wrote: >>>> Another question, by far most packages I have encountered either >>>> lead with a 0 or a 1 for "A". Does that have some bearing on the >>>> long term stability that package users should expect in the future? >>>> >>>> >>>> This is something that happens a lot in open source, in Haskell or >>>> elsewhere. We We programmers are afraid of calling something 1.0, >>>> because that somehow means "done", which we never (think we) are. :) >>>> Lots of really stable Haskell libraries (e.g. containers) are still on >>>> version 0.X. >>> >>> Upper bounds contribute to this problem, too. >>> >>> Suppose you've decided that 'containers' is stable enough to be at 1.0. >>> >>> Now all packages need to be updated, because they most probably depend >>> on 'containers < 1' or tighter. >>> >>> We saw something similar with text, people got angry. >>> >>> If a library becomes popular before it reaches 1.0, it probably never will. >> >> I don't understand this. How is bumping 'A' different from bumping >> 'B'? You could just bump 'A' (to 1, for example) instead of 'B' when >> you make an API breaking change, and it's no extra effort for people >> who depend on you. > > So I need to wait till I have an API-breaking change in order to mark a > package as stable? That's... ironic. > > Also, if the library is stable enough, people would constraint the A > version (e.g. 'containers < 1'), asserting that their package will > probably continue to build even under minor API-breaking changes which > are typical for stable packages. Now, by bumping my A version for a > minor breaking change, I'm acting exactly against their intention, > saying "hey, this is a massive change, you'd better pay attention before > using it". That's not what an actual stable package is supposed to do. Is depending on an 'A' component a thing that people actually do for libraries (other than base, perhaps)? The PVP gives no guarantees about it, and I haven't seen any specific packages make guarantees about it either. Without guarantees, it would probably be better for these people to remove the bounds altogether. I do the same when e.g. I only depend on the 'Text' type, and no functions from the package. Erik From tab at snarc.org Tue Dec 16 11:39:00 2014 From: tab at snarc.org (Vincent Hanquez) Date: Tue, 16 Dec 2014 11:39:00 +0000 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: <54901628.3070101@ro-che.info> References: <54900E47.6010201@ro-che.info> <54901628.3070101@ro-che.info> Message-ID: <549019D4.8070409@snarc.org> On 16/12/2014 11:23, Roman Cheplyaka wrote: > So I need to wait till I have an API-breaking change in order to mark a > package as stable? That's... ironic. This is one of my issue with the PvP. with the PvP versioning you're not able to convey any other informations apart from the API "changing". Which means you can't properly convey: * major new features: by bumping the major, despite the API not changing * security (by bumping the minor or patchlevel, regardless if the API change) * the stability (bumping to 1.x). Text is one of canonical example when it was bumped to 1.x recently and lots of people complained that it wasn't the right thing to do. > Also, if the library is stable enough, people would constraint the A > version (e.g. 'containers < 1'), asserting that their package will > probably continue to build even under minor API-breaking changes which > are typical for stable packages. Now, by bumping my A version for a > minor breaking change, I'm acting exactly against their intention, > saying "hey, this is a massive change, you'd better pay attention before > using it". That's not what an actual stable package is supposed to do. > Indeed. -- Vincent From corentin.dupont at gmail.com Tue Dec 16 14:05:47 2014 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Tue, 16 Dec 2014 15:05:47 +0100 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: <549019D4.8070409@snarc.org> References: <54900E47.6010201@ro-che.info> <54901628.3070101@ro-che.info> <549019D4.8070409@snarc.org> Message-ID: My opinion is that the version number shouldn't convey the idea of stability. It should be another field :) In fact in Cabal there is a stability field: https://www.haskell.org/cabal/users-guide/developing-packages.html#package-properties But it's not very well specified/used. Anyway the fact that we like to have "V1.0" to mean "work done" is more a question of aesthetic. The version number carries three different informations IMO: - tagging a specific state of the sources, - give an order between the versions, - give information about the level of changes. The third one could be separated. It could be made into a field containing the level of changes, such as "minor changes"/"API breaking changes". Then the version tag could be made what you want, even tagging "V1.0" a minor change. Just my 2 cent :) On Tue, Dec 16, 2014 at 12:39 PM, Vincent Hanquez wrote: > > > On 16/12/2014 11:23, Roman Cheplyaka wrote: > >> So I need to wait till I have an API-breaking change in order to mark a >> package as stable? That's... ironic. >> > This is one of my issue with the PvP. with the PvP versioning you're not > able to convey any other informations apart from the API "changing". > > Which means you can't properly convey: > > * major new features: by bumping the major, despite the API not changing > * security (by bumping the minor or patchlevel, regardless if the API > change) > * the stability (bumping to 1.x). > > Text is one of canonical example when it was bumped to 1.x recently and > lots of people complained that it wasn't the right thing to do. > > Also, if the library is stable enough, people would constraint the A >> version (e.g. 'containers < 1'), asserting that their package will >> probably continue to build even under minor API-breaking changes which >> are typical for stable packages. Now, by bumping my A version for a >> minor breaking change, I'm acting exactly against their intention, >> saying "hey, this is a massive change, you'd better pay attention before >> using it". That's not what an actual stable package is supposed to do. >> >> Indeed. > > -- > Vincent > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From felipe.lessa at gmail.com Tue Dec 16 16:00:19 2014 From: felipe.lessa at gmail.com (Felipe Lessa) Date: Tue, 16 Dec 2014 14:00:19 -0200 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: <20141216091824.GD28609@nibbler> References: <20141216091824.GD28609@nibbler> Message-ID: <54905713.4020402@gmail.com> On 16-12-2014 07:18, Tobias Dammers wrote: > IIRC, the rules (for libraries at least) are (correct me if I'm wrong): These are not rules encoded by the PVP. The PVP doesn't prescribe how A or B should be changed besides stating when the major version should be bumped. This can be accomplished by increasing either A or B, but it's entirely up to the author to decide which. Any author is free to use whatever rule they see fit. Cheers, -- Felipe. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From zach.moazeni at gmail.com Tue Dec 16 17:31:05 2014 From: zach.moazeni at gmail.com (Zach Moazeni) Date: Tue, 16 Dec 2014 12:31:05 -0500 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: <54905713.4020402@gmail.com> References: <20141216091824.GD28609@nibbler> <54905713.4020402@gmail.com> Message-ID: Thanks everyone for your feedback! >From what I'm hearing it sounds like in the scheme "A.B.C.D" is roughly handled like this: (I know "D" isn't technically in the PVP) * If the change includes a major overhaul to the design of the package, A should be bumped. Things like all modules changed, introducing a new monad that should be used instead, etc. * If the change includes non-backwards compatible features that lives inside the existing design, only B should be bumped. Things like refactoring existing functions, changing the signature and/or introducing new data types for existing functions. * If the change includes backwards compatible changes, only C should be bumped. Things like adding a new convenience function. Adding brand new functions/modules that didn't have any existing counterpart. * (Unspoken, but many people do it) If the change includes a minor backwards compatible fix, D should be bumped. A typo in a string, a security patch that doesn't change the signature or typical behavior. Changing the package's dependencies also feels like it could either end up bumping B if you're changing the minimum requirements of existing dependencies, or C if you introduce a new dependency. Obviously some package maintainers will deviate from above. However, if I've summarized the typical community process, could we add these examples (or a variation of them) to https://www.haskell.org/haskellwiki/Package_versioning_policy ? As a newcommer, this would have helped me out to understand how people version packages and to have some idea of interpreting the version history on hackage pages. If there's not too much objection to that inclusion, is there a way I can help aid that wiki change process? Tobias wrote: > When you introduce a new entity in the public interface, such as a new > typeclass, a new exported type, a new exported function, etc., you > should bump the *second* number. This is because such introductions > are only breaking changes when the consumer imports your modules > unqualified and completely (i.e. `import The.Module`, not `import > qualified The.Module as TM` nor `import The.Module (foo, bar)`). > Importing your module "safely" will not break anything because the > previous entities are still there, and the new ones simply won't be > imported, so they cannot cause any clashes. If you ignore the case of orphan instances, from what I read of the PVP this is very loosely interpreting the phrase "*A.B* may remain the same...". I would honestly expect C to be bumped in this scenario instead because what you describe sounds like a backwards compatible addition. In fact it gets a little more odd since the same sentence says "...the new *C* must be greater than the old *C". *Bumping **both** B and C feels odd to me. Roman wrote: > We saw something similar with text, people got angry. If a library becomes > popular before it reaches 1.0, it probably never will. Johan wrote: > Lots of really stable Haskell libraries (e.g. containers) are still on > version 0.X. Vincent wrote: > Text is one of canonical example when it was bumped to 1.x recently and > lots of people complained that it wasn't the right thing to do. > Corentin wrote: > Anyway the fact that we like to have "V1.0" to mean "work done" is more a > question of aesthetic. I know upper bound constraints is a contentious topic in the Haskell community. I was trying to avoid bringing that up altogether for these questions. Setting aside the common "at what point do the maintainer(s) commit to the existing API and mark the big 1 point 0" dilemma, very stable 0.x packages are one of the reasons why I was confused and asked the list. It feels like the PVP encourages packages to not ever go 1.0 since bumping B (0.1, 0.2) are considered major versions, and therefore packages can continue their stable maintenance ignoring A forever (excluding major overhauls discussed above of course). In my opinion, that is confusing behavior and should not be encouraged. It's a bummer to me to hear that people got upset when Text went from 0.11 to 1.0. Does anyone have any links to the threads where people were upset because of the Text 1.0 change? I'd like know if it was just simply because they had to change the upper bound constraint for many packages or if there was more to it than that. I found a few emails when it occurred https://www.haskell.org/pipermail/haskell-cafe/2013-December/111845.html but nothing beyond that. -Zach On Tue, Dec 16, 2014 at 11:00 AM, Felipe Lessa wrote: > > On 16-12-2014 07:18, Tobias Dammers wrote: > > IIRC, the rules (for libraries at least) are (correct me if I'm wrong): > > These are not rules encoded by the PVP. The PVP doesn't prescribe how A > or B should be changed besides stating when the major version should be > bumped. This can be accomplished by increasing either A or B, but it's > entirely up to the author to decide which. Any author is free to use > whatever rule they see fit. > > Cheers, > > -- > Felipe. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- -Zach -------------- next part -------------- An HTML attachment was scrubbed... URL: From aditya.siram at gmail.com Tue Dec 16 18:41:09 2014 From: aditya.siram at gmail.com (aditya siram) Date: Tue, 16 Dec 2014 12:41:09 -0600 Subject: [Haskell-cafe] Request For Feedback: Emulating OO-style dispatch for binding ... Message-ID: I am writing a GUI binding but unfortunately could not find a OO-style dispatching scheme that I was happy with so I wrote my own ( https://gist.github.com/deech/6528a75e480378182052 ). The design goal is to: - provide a single function that will dispatch to a custom implementation based on the type of argument it is given - allow the user to extend and subclass the hierarchy and override functions in a way that doesn't involve recompiling the binding - use as few new extensions as possible - provide as familiar an API as possible, thereby allowing users to leverage existing documentation maintained by the C++ project. The look-and-feel of the API is on lines 128-140. It should just be a stand-alone file that can be loaded into GHCI. Thanks for your feedback! -deech -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Tue Dec 16 19:44:14 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Tue, 16 Dec 2014 11:44:14 -0800 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: References: <20141216091824.GD28609@nibbler> <54905713.4020402@gmail.com> Message-ID: It sounds like we're trying to shoehorn more information into a single ordinal value than it can represent. It might be unreasonable to expect to be able to learn so much from so little. In my own code, if I want to look back at which changes were small and which were big, I read the Subversion comments for each revision. I do like the idea of reducing the text footprint of that information to three or four numbers -- it would be easier to read fast -- but I have yet to imagine how. On Tue, Dec 16, 2014 at 9:31 AM, Zach Moazeni wrote: > > Thanks everyone for your feedback! > > From what I'm hearing it sounds like in the scheme "A.B.C.D" is roughly > handled like this: (I know "D" isn't technically in the PVP) > > * If the change includes a major overhaul to the design of the package, A > should be bumped. Things like all modules changed, introducing a new monad > that should be used instead, etc. > > * If the change includes non-backwards compatible features that lives > inside the existing design, only B should be bumped. Things like > refactoring existing functions, changing the signature and/or introducing > new data types for existing functions. > > * If the change includes backwards compatible changes, only C should be > bumped. Things like adding a new convenience function. Adding brand new > functions/modules that didn't have any existing counterpart. > > * (Unspoken, but many people do it) If the change includes a minor > backwards compatible fix, D should be bumped. A typo in a string, a > security patch that doesn't change the signature or typical behavior. > > Changing the package's dependencies also feels like it could either end up > bumping B if you're changing the minimum requirements of existing > dependencies, or C if you introduce a new dependency. > > Obviously some package maintainers will deviate from above. However, if > I've summarized the typical community process, could we add these examples > (or a variation of them) to > https://www.haskell.org/haskellwiki/Package_versioning_policy ? As a > newcommer, this would have helped me out to understand how people version > packages and to have some idea of interpreting the version history on > hackage pages. If there's not too much objection to that inclusion, is > there a way I can help aid that wiki change process? > > > > > Tobias wrote: > >> When you introduce a new entity in the public interface, such as a new >> typeclass, a new exported type, a new exported function, etc., you >> should bump the *second* number. This is because such introductions >> are only breaking changes when the consumer imports your modules >> unqualified and completely (i.e. `import The.Module`, not `import >> qualified The.Module as TM` nor `import The.Module (foo, bar)`). >> Importing your module "safely" will not break anything because the >> previous entities are still there, and the new ones simply won't be >> imported, so they cannot cause any clashes. > > > If you ignore the case of orphan instances, from what I read of the PVP > this is > very loosely interpreting the phrase "*A.B* may remain the same...". I > would honestly expect C to be bumped in this scenario instead because what > you describe sounds like a backwards compatible addition. In fact it gets a > little more odd since the same sentence says "...the new *C* must be > greater than the old *C". *Bumping **both** B and C feels odd to me. > > > > > Roman wrote: > >> We saw something similar with text, people got angry. If a library >> becomes popular before it reaches 1.0, it probably never will. > > > Johan wrote: > >> Lots of really stable Haskell libraries (e.g. containers) are still on >> version 0.X. > > > Vincent wrote: > >> Text is one of canonical example when it was bumped to 1.x recently and >> lots of people complained that it wasn't the right thing to do. >> > > Corentin wrote: > >> Anyway the fact that we like to have "V1.0" to mean "work done" is more a >> question of aesthetic. > > > I know upper bound constraints is a contentious topic in the Haskell > community. I was trying to avoid bringing that up altogether for these > questions. Setting aside the common "at what point do the maintainer(s) > commit to the existing API and mark the big 1 point 0" dilemma, very stable > 0.x packages are one of the reasons why I was confused and asked the list. > > It feels like the PVP encourages packages to not ever go 1.0 since bumping > B (0.1, 0.2) are considered major versions, and therefore packages can > continue their stable maintenance ignoring A forever (excluding major > overhauls discussed above of course). In my opinion, that is confusing > behavior and should not be encouraged. It's a bummer to me to hear that > people got upset when Text went from 0.11 to 1.0. > > Does anyone have any links to the threads where people were upset because > of the Text 1.0 change? I'd like know if it was just simply because they > had to change the upper bound constraint for many packages or if there was > more to it than that. I found a few emails when it occurred > https://www.haskell.org/pipermail/haskell-cafe/2013-December/111845.html > but nothing beyond that. > > -Zach > > > On Tue, Dec 16, 2014 at 11:00 AM, Felipe Lessa > wrote: > >> On 16-12-2014 07:18, Tobias Dammers wrote: >> > IIRC, the rules (for libraries at least) are (correct me if I'm wrong): >> >> These are not rules encoded by the PVP. The PVP doesn't prescribe how A >> or B should be changed besides stating when the major version should be >> bumped. This can be accomplished by increasing either A or B, but it's >> entirely up to the author to decide which. Any author is free to use >> whatever rule they see fit. >> >> Cheers, >> >> -- >> Felipe. >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > -- > -Zach > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From danburton.email at gmail.com Tue Dec 16 21:23:04 2014 From: danburton.email at gmail.com (Dan Burton) Date: Tue, 16 Dec 2014 13:23:04 -0800 Subject: [Haskell-cafe] Haskell Polishing [was: Missing `$` like operators in Haskell] In-Reply-To: References: Message-ID: > > Anyone tried to address this issue? Which one? The proliferation of operators? Or library quality? Or libraries overlapping in intent and interface? Haskell has two levels of "standard library" (base and Haskell Platform), and two levels of "open source third party library" (Stackage and Hackage). Between all the teams for ghc, haskell platform, stackage, and haskell.org, there's quite a lot of people that have been working generally on Haskell's library situation. On the other hand, I don't know anybody that has been working on cutting down on operators. (lens seems quite determined to accomplish just the opposite.) -- Dan Burton On Tue, Dec 16, 2014 at 12:41 AM, Giacomo Tesio wrote: > > 2014-12-12 14:22 GMT+01:00 Johan Tibell : >> >> Everything doesn't have to have an operator! We use operators a bit too >> much. It hurts readability of code when lines start looking like APL. >> >> > Probably this has been discussed already (and I'd like to read previous > material, btw, so please give me some reference), but as a long time > programmer with experience in many different paradigms and languages I too > feel Haskell a bit cumbersome from this point of view. > > I mean, the language in itself is the best I know, but libraries have > different levels of quality and in general they miss organization: they > often overlap in intent and interface, for example. > > > Anyone tried to address this issue? And if so, how? > > I can see how backward compatibility prevents Haskell to be polished, but > it's a pity. > It's like an handbrake for it's evolution and adoption! > > > > Giacomo > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wojtek at power.com.pl Tue Dec 16 22:08:34 2014 From: wojtek at power.com.pl (=?UTF-8?B?V29qdGVrIE5hcmN6ecWEc2tp?=) Date: Tue, 16 Dec 2014 23:08:34 +0100 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <20141216083910.GA28609@nibbler> References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> Message-ID: <5490AD62.1040605@power.com.pl> On 16.12.2014 09:39, Tobias Dammers wrote: > On Mon, Dec 15, 2014 at 11:01:12PM +0100, Wojtek Narczy?ski wrote: >> On 15.12.2014 20:32, Tobias Dammers wrote: >> >>> Anyway, one thing I'm running up against is that I am going to need >>> ordered key/value collections, which I believe is something JSON does >>> not support out-of-the-box: "objects" ({"foo":15, "bar":23}) are >>> conceptually unordered key/value collections (and Aeson treats them as >>> such, using hash maps as the intermediate storage format), so I lose >>> ordering; >> JSON does not forbid ordering of maps by key, I believe. But you'd need to >> create an OrderedMap and patch aeson. It would be very useful, the mixing of >> key order is nuisance for human JSON consumers. > No, that's not what I meant. By "ordered", I meant that the in-memory > representation of the document should maintain file order. Aeson uses a > HashMap to store key/value objects, which is an unordered container; > what you suggest would be something like Map (storing elements by key > order), but what I'm talking about is more like [(Key, Value)], i.e., > keeping file order intact. > I meant a container maintaining order of additions. Indeed, it's not an OrderedMap, rather InOrderOfArrivalMap. > I absolutely don't want to use "looks like JSON but isn't", I really want to stick with standard JSON, > for so many reasons. As long as the keys are unique, it is JSON, order of keys does not matter. Caveat emptor. From ok at cs.otago.ac.nz Tue Dec 16 23:12:00 2014 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Wed, 17 Dec 2014 12:12:00 +1300 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <20141216083910.GA28609@nibbler> References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> Message-ID: <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> On 16/12/2014, at 9:39 pm, Tobias Dammers wrote: > No, that's not what I meant. By "ordered", I meant that the in-memory > representation of the document should maintain file order. You did consult RFC 4627, right? Page 1: "An object is an UNORDERED collection of zero or more name/value pairs?. Or www.json.org? Just above the railroad diagram for objects, ?An object is an UNORDERED SET of name/value pairs.? Or RFC 7159? Section 1: ?An object is an UNORDERED collection of zero or more name/value pairs?. The new thing in RFC 7159 is "JSON parsing libraries have been observed to differ as to whether or not they make the ordering of object members visible to calling software. Implementations whose behavior does not depend on member ordering will be interoperable in the sense that they will not be affected by these differences.? That is, the file order is WITHOUT SIGNIFICANCE. If you happen to use a library that preserves that order in memory, NOTHING SHOULD DEPEND ON THAT if you want your software to be interoperable. Recall that JSON is explicitly derived from Javascript and that a JSON ?object? is explicitly (www.json.org) "an object, record, struct, dictionary, hash table, keyed list, or associative array? so that the *intended* in-memory representation for a JSON object is an *unordered* data structure. So if you depend on the order of the name/value pairs in a JSON object, you doing something surpassing strange and risky. From tdammers at gmail.com Wed Dec 17 08:23:12 2014 From: tdammers at gmail.com (Tobias Dammers) Date: Wed, 17 Dec 2014 09:23:12 +0100 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <5490AD62.1040605@power.com.pl> References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> <5490AD62.1040605@power.com.pl> Message-ID: <20141217082254.GA26980@nibbler> On Tue, Dec 16, 2014 at 11:08:34PM +0100, Wojtek Narczy?ski wrote: > > > As long as the keys are unique, it is JSON, order of keys does not matter. The thing is, yes, it is syntactically valid JSON, which suggests that the order of keys do not matter, but for my application, I need a key/value collection where order *does* matter, which means that while my syntactic representation would be exactly JSON, my program would be semantically incorrect. > > Caveat emptor. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tobias Dammers - tobias at twokings.nl - 070-3457628 - www.twokings.nl Maandag t/m donderdag van 9.00 tot 17.30 Voor dringende vragen, mail naar support at twokings.nl From michael at snoyman.com Wed Dec 17 08:24:21 2014 From: michael at snoyman.com (Michael Snoyman) Date: Wed, 17 Dec 2014 08:24:21 +0000 Subject: [Haskell-cafe] PVP question References: <548F1600.4030700@ro-che.info> <548F6331.8050502@ro-che.info> <548FFFEC.4090007@ro-che.info> Message-ID: I appreciate everyone's input on this. I've decided I'm going to treat this as a minor version bump, for the following reasons: * It's unclear that *any* breakage will occur. * If any breakage does occur, it should be trivial to fix in a backwards compatible way. * And while breakage is generally a bad thing, in this case, it would likely be beneficial to the community if we got extra data out of the exercise by having a build breakage result from this change. If I hear any reports of breakage as a result of this change, I'll try to remember to report them. On Tue Dec 16 2014 at 11:48:41 AM Roman Cheplyaka wrote: > On 16/12/14 11:40, Erik Hesselink wrote: > > On Mon, Dec 15, 2014 at 11:39 PM, Roman Cheplyaka > wrote: > >> On 16/12/14 00:31, Johan Tibell wrote: > >>> So yes, if you use open imports and allow new minor versions, your code > >>> might break. This is expected. > >> > >> One similarly could argue that "if you use functions in polymorphic > >> contexts and allow new minor versions, your code might break". > >> > >> This isn't in the PVP, but it's exactly in the same spirit, IMO. > > > > I think this is a bad idea, since a "polymorphic context" (even if > > rigorously defined) is not clear from reading the code, you have to > > type check it in your head. The import style, on the other hand, is > > very simple to read and check if it matches the style of dependency > > version ranges. > > Ok, this is a fair point. > > Roman > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wojtek at power.com.pl Wed Dec 17 08:26:39 2014 From: wojtek at power.com.pl (=?UTF-8?B?V29qdGVrIE5hcmN6ecWEc2tp?=) Date: Wed, 17 Dec 2014 09:26:39 +0100 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> Message-ID: <54913E3F.8060003@power.com.pl> On 17.12.2014 00:12, Richard A. O'Keefe wrote: > On 16/12/2014, at 9:39 pm, Tobias Dammers wrote: >> No, that's not what I meant. By "ordered", I meant that the in-memory >> representation of the document should maintain file order. > You did consult RFC 4627, right? > > Page 1: "An object is an UNORDERED collection of > zero or more name/value pairs?. > > Okay, I was plain wrong. From wojtek at power.com.pl Wed Dec 17 08:59:10 2014 From: wojtek at power.com.pl (=?UTF-8?B?V29qdGVrIE5hcmN6ecWEc2tp?=) Date: Wed, 17 Dec 2014 09:59:10 +0100 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> Message-ID: <549145DE.90605@power.com.pl> On 17.12.2014 00:12, Richard A. O'Keefe wrote: > So if you depend on the order of the name/value pairs in > a JSON object, you doing something surpassing strange and > risky. All I wanted to do was to keep the order of key-value pairs in accordance with the order of fields in their corresponding haskell records, during serialization. I guess that would be okay. From tdammers at gmail.com Wed Dec 17 09:01:40 2014 From: tdammers at gmail.com (Tobias Dammers) Date: Wed, 17 Dec 2014 10:01:40 +0100 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> Message-ID: <20141217090132.GB26980@nibbler> On Wed, Dec 17, 2014 at 12:12:00PM +1300, Richard A. O'Keefe wrote: > > On 16/12/2014, at 9:39 pm, Tobias Dammers wrote: > > No, that's not what I meant. By "ordered", I meant that the in-memory > > representation of the document should maintain file order. > > You did consult RFC 4627, right? > > So if you depend on the order of the name/value pairs in > a JSON object, you doing something surpassing strange and > risky. No need to go all RTFM on me; "JSON objects are unordered" is exactly what I was basing my reasoning on. I am not planning on depending on the order of something that is unordered by definition. However, my requirements are: 1. File format must be valid JSON (or occasionally YAML, or at least the JSON-isomorphic subset) 2. I need to represent ordered key/value collections 3. Conversion from JSON to the internal data type must be total (i.e., any valid JSON document must be accepted and converted to the most reasonable internal representation). Since JSON objects are (semantically) unordered, and the only way to get an ordered collection in JSON is through an array, my choices are: a) Use something that looks like JSON but defines objects as ordered key/value collections; this is something I *really* don't want, because it can break so many assumptions, and I would have to write my own JSON (and YAML) parsers for no good reason. b) Use an array of one-element objects. c) Use an array of keys and a key/value object side-by side. d) Use an array of objects, with a 'magic' property providing a tag name, and another magic property providing the payload value. e) Exactly like d), but gracefully accept other array elements, treating them as unnamed values. What I have implemented now is option e), with "_name" and "_value" for the magic properties; if neither is given, the element itself becomes an unnamed value, and can only be looked up by position; if a name is given but no value, it becomes a named null entry; if both are given, a proper name/value pair is generated. I'm still working out the details of if and what to throw away when an entry has both a "_value" and other properties, but other than that, I think this is as good as it gets. -- Tobias Dammers - tobias at twokings.nl - 070-3457628 - www.twokings.nl Maandag t/m donderdag van 9.00 tot 17.30 Voor dringende vragen, mail naar support at twokings.nl From tdammers at gmail.com Wed Dec 17 09:06:12 2014 From: tdammers at gmail.com (Tobias Dammers) Date: Wed, 17 Dec 2014 10:06:12 +0100 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <549145DE.90605@power.com.pl> References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> <549145DE.90605@power.com.pl> Message-ID: <20141217090611.GC26980@nibbler> On Wed, Dec 17, 2014 at 09:59:10AM +0100, Wojtek Narczy?ski wrote: > On 17.12.2014 00:12, Richard A. O'Keefe wrote: > >So if you depend on the order of the name/value pairs in > >a JSON object, you doing something surpassing strange and > >risky. > All I wanted to do was to keep the order of key-value pairs in accordance > with the order of fields in their corresponding haskell records, during > serialization. I guess that would be okay. It would still be problematic if you rely on this order to come back unchanged after putting your JSON through any processing. For example, if you have a JSON document like this: { "foo":23, "bar":"$quux" } ...and you pipe it through a Ruby script that walks through it and substitutes some value (say 42) wherever you have "$quux", you must be prepared to receive it back as: { "bar":42, "foo":23 } It is perfectly acceptable for your own processor to keep the ordering intact, but you cannot expect anything else to do the same for you. It also means that you cannot use Aeson to parse or represent your JSON, because it uses HashMaps to store objects, and those are by definition unordered containers. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tobias Dammers - tobias at twokings.nl - 070-3457628 - www.twokings.nl Maandag t/m donderdag van 9.00 tot 17.30 Voor dringende vragen, mail naar support at twokings.nl From waldmann at imn.htwk-leipzig.de Wed Dec 17 08:19:25 2014 From: waldmann at imn.htwk-leipzig.de (Johannes Waldmann) Date: Wed, 17 Dec 2014 08:19:25 +0000 (UTC) Subject: [Haskell-cafe] how to handle FILE* with c2hs Message-ID: Hi. I could use an example of how to handle files (FILE *) with c2hs, but could not find any. I want to call some "void dump (..., FILE * f)" function. I want to use this for a handle that I obtained in Haskell land. Sure I can rewrite/add the C code so that it takes a filepath (string) and opens the file by itself, but should I? - J.W. From ian at skybluetrades.net Wed Dec 17 10:00:21 2014 From: ian at skybluetrades.net (Ian Ross) Date: Wed, 17 Dec 2014 11:00:21 +0100 Subject: [Haskell-cafe] how to handle FILE* with c2hs In-Reply-To: References: Message-ID: Hi Johannes, The following might give you some ideas: module Main where import Control.Monad import Foreign import Foreign.ForeignPtr import Foreign.C.String import Foreign.C.Types #include {#pointer *FILE as File foreign finalizer fclose newtype#} {#fun fopen as ^ {`String', `String'} -> `File'#} {#fun fgetc as ^ {`File'} -> `Int'#} main :: IO () main = do fp <- fopen "tst.dat" "r" c <- fgetc fp print c (The "foreign finalizer" thing requires a recent C2HS.) Cheers, Ian. On 17 December 2014 at 09:19, Johannes Waldmann < waldmann at imn.htwk-leipzig.de> wrote: > > Hi. > > I could use an example of how to handle files (FILE *) with c2hs, > but could not find any. > > I want to call some "void dump (..., FILE * f)" function. > I want to use this for a handle that I obtained in Haskell land. > > Sure I can rewrite/add the C code so that it takes a filepath (string) > and opens the file by itself, but should I? > > - J.W. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Ian Ross Tel: +43(0)6804451378 ian at skybluetrades.net www.skybluetrades.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From kyle.marek.spartz at gmail.com Wed Dec 17 15:19:46 2014 From: kyle.marek.spartz at gmail.com (Kyle Marek-Spartz) Date: Wed, 17 Dec 2014 09:19:46 -0600 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> Message-ID: <2fcp3s8ui6l2wd.fsf@kmarekspartz-mbp.stp01.office.gdi> That's pedantic and beside the point. The question is not what JSON supports, but rather how to best represent data which consists of ordered key-value pairs using JSON. I'll second the solution of [{"key1": "value"}, {"key2": "value"}]. Richard A. O'Keefe writes: > On 16/12/2014, at 9:39 pm, Tobias Dammers wrote: >> No, that's not what I meant. By "ordered", I meant that the in-memory >> representation of the document should maintain file order. > > You did consult RFC 4627, right? > > Page 1: "An object is an UNORDERED collection of > zero or more name/value pairs?. > > Or www.json.org? > > Just above the railroad diagram for objects, > ?An object is an UNORDERED SET of name/value pairs.? > > Or RFC 7159? > Section 1: ?An object is an UNORDERED collection of > zero or more name/value pairs?. > The new thing in RFC 7159 is > "JSON parsing libraries have been observed to differ as to whether or not > they make the ordering of object members visible to calling software. > Implementations whose behavior does not depend on member ordering will be > interoperable in the sense that they will not be affected by these differences.? > > That is, the file order is WITHOUT SIGNIFICANCE. > If you happen to use a library that preserves that order > in memory, NOTHING SHOULD DEPEND ON THAT if you > want your software to be interoperable. > > Recall that JSON is explicitly derived from Javascript and > that a JSON ?object? is explicitly (www.json.org) > "an object, record, struct, dictionary, hash table, keyed list, > or associative array? so that the *intended* in-memory > representation for a JSON object is an *unordered* data > structure. > > So if you depend on the order of the name/value pairs in > a JSON object, you doing something surpassing strange and > risky. > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Kyle Marek-Spartz From donn at avvanta.com Wed Dec 17 15:44:14 2014 From: donn at avvanta.com (Donn Cave) Date: Wed, 17 Dec 2014 07:44:14 -0800 (PST) Subject: [Haskell-cafe] how to handle FILE* with c2hs In-Reply-To: References: Message-ID: <20141217154414.EF9F993C43@mail.avvanta.com> Quoth Johannes Waldmann , > I want to call some "void dump (..., FILE * f)" function. > I want to use this for a handle that I obtained in Haskell land. > > Sure I can rewrite/add the C code so that it takes a filepath (string) > and opens the file by itself, but should I? You could move that logic into Haskell, as illustrated in a previous follow-up, but I can't think of any direct interface between C FILE and Haskell Handle, and I guess that because of the essential internal nature of the two, that's to be expected. (Or maybe I just don't know where to look!) In a POSIX situation you could get the system file descriptor from the Handle, and convert that to a FILE pointer, but at the cost of closing the Handle. Don't know if that would work so well on non-POSIX platforms. If the Haskell side will simply open the file for this purpose, then I think you indeed might as well do that in C (whether by calling fopen() from Haskell or writing a C wrapper that takes a file path name.) Donn From allbery.b at gmail.com Wed Dec 17 15:51:58 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 17 Dec 2014 10:51:58 -0500 Subject: [Haskell-cafe] how to handle FILE* with c2hs In-Reply-To: <20141217154414.EF9F993C43@mail.avvanta.com> References: <20141217154414.EF9F993C43@mail.avvanta.com> Message-ID: On Wed, Dec 17, 2014 at 10:44 AM, Donn Cave wrote: > > You could move that logic into Haskell, as illustrated in a previous > follow-up, but I can't think of any direct interface between C FILE > and Haskell Handle, and I guess that because of the essential internal > nature of the two, that's to be expected. (Or maybe I just don't > know where to look!) > About the only one is the underlying OS file descriptor; GHC's runtime implements its own native file handles, it does not wrap C stdio, and you cannot round-trip between a stdio (FILE *) and a GHC Handle. Using the file descriptor should work on both POSIX and Windows, as long as it's an ordinary file (that is, not a device, fifo, socket, directory (netbsd/freebsd), mailbox, etc.). You will need to use fdToHandle / handleToFd on the Haskell side and fdopen()/fileno() on the C side; the Haskell ones will ensure the buffers are properly dealt with, the C ones you must make sure to do so yourself. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From riivo.kolka at gmail.com Wed Dec 17 17:04:12 2014 From: riivo.kolka at gmail.com (Riivo Kolka) Date: Wed, 17 Dec 2014 19:04:12 +0200 Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: References: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> Message-ID: On 14 December 2014 at 18:52, Manuel G?mez wrote: > Congratulations on the release! It?s great to see more and more > interesting abstractions for relational databases in the Haskell > ecosystem. Hi * I chime in for the first time. Haskell is my favourite language. I really don't program in it, I have done it very little. I like more reading about Haskell (et al). What I really do, is work with geo(yay) data(yay)BaseManagementSystems(meh) and SQL(yuck). Yes, despite SQLs yuckiness I feel myself most naturally among NATURAL JOIN and other relationally algebraic friends. I'm very sorry, but I had a strong gut reaction to Manuels sentiment. Really?! What's so great about it? Isn't this rather a sign that something is askew? For such an important, ubiquitous yet mundane task as accessing database there shouldn't be so many ad hoc half-baked (sorry - with some limitations) solutions. That's unfair, I know. I look at those examples and think, this is not the Haskell I'd like to write and despite type safety and composability, which are great features, it's not even the query language I'd like to write. Ie it's not better than SQL, yet. I mean, I understand the need to talk to SQL DMBS-s. I guess I'm just sad and angry that the great talent of library authors is wasted on such endeavor. Of course no Haskell programmer wants to write SQL, because the L is so askew in SQL. (apologies to Hugh Darwen). BUT, but. If Haskell hasn't got tuples as in relations (named, not ordered), type system such that tuple types' arity is not fixed (if that's the correct way to put it) and types for sets of such tuples aka relation type, then how can Haskell support databases and relational algebra NATURALLY? On the other hand, if Haskell had those, it would be quite a relational language, right? And a GREAT one, no? Anyway, bye! Riivo From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Wed Dec 17 17:36:30 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 17 Dec 2014 17:36:30 +0000 Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: References: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> Message-ID: <20141217173630.GZ7757@weber> On Wed, Dec 17, 2014 at 07:04:12PM +0200, Riivo Kolka wrote: > On 14 December 2014 at 18:52, Manuel G?mez wrote: > > Congratulations on the release! It?s great to see more and more > > interesting abstractions for relational databases in the Haskell > > ecosystem. [...] > I'm very sorry, but I had a strong gut reaction to Manuels sentiment. > Really?! What's so great about it? Isn't this rather a sign that > something is askew? For such an important, ubiquitous yet mundane task > as accessing database there shouldn't be so many ad hoc half-baked > (sorry - with some limitations) solutions. That's unfair, I know. Hello Riivo, It's not clear to me from your message whether you've looked at Opaleye, a relation query embedded domain specific language for Haskell http://hackage.haskell.org/package/opaleye I wrote it, so all due caveats about my opinion apply, but I do not consider Opaleye either ad hoc or half-baked. Opaleye has a solid theoretical foundation and thorough attention has been given to its semantics. > I look at those examples and think, this is not the Haskell I'd like > to write and despite type safety and composability, which are great > features, it's not even the query language I'd like to write. Ie it's > not better than SQL, yet. If you feel this way about writing code using Opaleye perhaps you could be more specific so I can get a clearer understanding of the issues involved. [...] > If Haskell hasn't got tuples as in relations (named, not ordered), type > system such that tuple types' arity is not fixed (if that's the correct > way to put it) and types for sets of such tuples aka relation type, then > how can Haskell support databases and relational algebra NATURALLY? On > the other hand, if Haskell had those, it would be quite a relational > language, right? And a GREAT one, no? I should mention at this point that I do not consider "relational algebra" to be a paragon to which to aspire. There is a lot of value in that body of work, but in the light of developments in programming language semantics over the last forty years relational algebra really appears to need an overhaul. (Technical note: One thing I noticed when writing Opaleye is that restriction, projection and inner join are different sorts of operation than aggregation and outer join, the former being what are called "algebraic operations", the latter not. I think the only way this observation can be made is if you encode relational algebra in a typed setting.) Opaleye is an implementation of relational algebra to about the same extent that Haskell is an implementation of the untyped lambda calculus, and I'm very happy with that difference between them. Tom From erantapaa at gmail.com Wed Dec 17 19:43:10 2014 From: erantapaa at gmail.com (Erik Rantapaa) Date: Wed, 17 Dec 2014 11:43:10 -0800 (PST) Subject: [Haskell-cafe] building hmatrix on OSX Message-ID: I'm trying to build hmatrix-0.16.1.1 on OSX 10.10.1, and I'm running into some undefined C functions and types in src/C/vector-aux.c: - struct random_data - random_r() - initstate_r() A specific error: src/C/vector-aux.c:738:24: error: variable has incomplete type 'struct random_data' struct random_data buffer; On a Linux system they seem to be defined in stdlib.h, but that doesn't seem to be the case on OSX. Is there a way to work around this? FWIW, I'm using GHC for OSX (https://ghcformacosx.github.io/) and I've installed `gsl` via `brew install gsl`. -------------- next part -------------- An HTML attachment was scrubbed... URL: From riivo.kolka at gmail.com Wed Dec 17 20:12:36 2014 From: riivo.kolka at gmail.com (Riivo Kolka) Date: Wed, 17 Dec 2014 22:12:36 +0200 Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: <20141217173630.GZ7757@weber> References: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> <20141217173630.GZ7757@weber> Message-ID: 17.12.2014 19:37 kirjutas kuup?eval "Tom Ellis" < tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk>: > > On Wed, Dec 17, 2014 at 07:04:12PM +0200, Riivo Kolka wrote: > > On 14 December 2014 at 18:52, Manuel G?mez wrote: > > > Congratulations on the release! It?s great to see more and more > > > interesting abstractions for relational databases in the Haskell > > > ecosystem. > [...] > > I'm very sorry, but I had a strong gut reaction to Manuels sentiment. > > Really?! What's so great about it? Isn't this rather a sign that > > something is askew? For such an important, ubiquitous yet mundane task > > as accessing database there shouldn't be so many ad hoc half-baked > > (sorry - with some limitations) solutions. That's unfair, I know. > > Hello Riivo, > > It's not clear to me from your message whether you've looked at Opaleye, a > relation query embedded domain specific language for Haskell > > http://hackage.haskell.org/package/opaleye > > I wrote it, so all due caveats about my opinion apply, but I do not consider > Opaleye either ad hoc or half-baked. Opaleye has a solid theoretical > foundation and thorough attention has been given to its semantics. > Tom I feel now really bad I wrote it that way. I'm actually excited about Haskell<>relational. How it can work. I may be going back to reading and thinking instead of posting inflammatory messages. I'm not comfortable going technical. I'm afraid It may take longer than you would expect for me to understand theoretical foundation of opaleye. Though I think I understand the foundation of relational theory. Riivo -------------- next part -------------- An HTML attachment was scrubbed... URL: From gautier.difolco at gmail.com Wed Dec 17 21:54:42 2014 From: gautier.difolco at gmail.com (Gautier DI FOLCO) Date: Wed, 17 Dec 2014 22:54:42 +0100 Subject: [Haskell-cafe] Parametric kinds Message-ID: Hello all, I'm trying to port typeclasses to kind-level, here are my data types: -- newtype Fix f a = Fix (f (Fix f a)) -- data Mu f = In (f (Mu f)) data Fix (f :: k1 -> k0) (n :: k1) = Fx data Maybe a = Nothing | Just a If I try to create type families to represent Functors, I end up with this: -- type family MapFix (f :: (* -> k) -> * -> k) a :: * where -- type family MapFix f a where type family MapFix (f :: (k0 -> k1) -> k0 -> k1) (a :: k2) :: * where MapFix f (Fix a n) = Fix (f a) (MapFix f n) -- type family MapMaybe (f :: k -> k) (a :: Maybe k) :: Maybe k where -- type family MapMaybe f a where type family MapMaybe (f :: k0 -> k1) (a :: Maybe k0) :: Maybe k1 where MapMaybe f ('Just a) = 'Just (f a) MapMaybe f 'Nothing = 'Nothing But I can't defined a single open type family for these two data types. I think I lack of parametric kinds, for example: `*k p*` could let me fit `*Maybe k*`. Currently, in the way I see kinds, on `*k0 -> k1*` allow me to parameterize kinds, but `*Maybe k*` doesn't fit. I know that this is certainly unclear, don't hesitate to ask me for clarifications. I also know that my `*Fix*` sucks, any good idea on how to do it is welcome :) Also, if you have any links to have a deeper insight of Kinds it will save me from mental illness. Thanks in advance for your help, Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Wed Dec 17 22:56:51 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 17 Dec 2014 22:56:51 +0000 Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: References: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> <20141217173630.GZ7757@weber> Message-ID: <20141217225650.GA7757@weber> On Wed, Dec 17, 2014 at 10:12:36PM +0200, Riivo Kolka wrote: > I'm afraid It may take longer than you would expect for me to understand > theoretical foundation of opaleye. Though I think I understand the > foundation of relational theory. My aim with Opaleye is very much that no one needs to know any theory in order to use it! From carter.schonwald at gmail.com Thu Dec 18 00:59:33 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 17 Dec 2014 19:59:33 -0500 Subject: [Haskell-cafe] building hmatrix on OSX In-Reply-To: References: Message-ID: did you file a bug report on the hmatrix issue tracker? You'll probably get good support there On Wed, Dec 17, 2014 at 2:43 PM, Erik Rantapaa wrote: > > I'm trying to build hmatrix-0.16.1.1 on OSX 10.10.1, and I'm running into > some undefined C functions and types in src/C/vector-aux.c: > > - struct random_data > - random_r() > - initstate_r() > > A specific error: > > src/C/vector-aux.c:738:24: > error: variable has incomplete type 'struct random_data' > struct random_data buffer; > > On a Linux system they seem to be defined in stdlib.h, but that doesn't > seem to be the case on OSX. > > Is there a way to work around this? > > FWIW, I'm using GHC for OSX (https://ghcformacosx.github.io/) and I've > installed `gsl` via `brew install gsl`. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok at cs.otago.ac.nz Thu Dec 18 02:12:41 2014 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Thu, 18 Dec 2014 15:12:41 +1300 Subject: [Haskell-cafe] Ordered JSON objects? In-Reply-To: <549145DE.90605@power.com.pl> References: <20141215193220.GA15214@yemaya> <548F5A28.40802@power.com.pl> <20141216083910.GA28609@nibbler> <41053FD1-C602-489F-9635-B8690D3663D4@cs.otago.ac.nz> <549145DE.90605@power.com.pl> Message-ID: On 17/12/2014, at 9:59 pm, Wojtek Narczy?ski wrote: > On 17.12.2014 00:12, Richard A. O'Keefe wrote: >> So if you depend on the order of the name/value pairs in >> a JSON object, you doing something surpassing strange and >> risky. > All I wanted to do was to keep the order of key-value pairs in accordance with the order of fields in their corresponding haskell records, during serialization. I guess that would be okay. At some point, you convert an internal value to a ?JSON? form, x. You hand that over to some other JSON-handling software, and eventually get the ?same? value back, x?. The other JSON-handling software could be something as simple as [StdIn skipSeparators] whileFalse: [ StdOut printJson: StdIn nextJson; cr]. Now x? may *legitimately* be different from x, both in the amount and location of white space, the presence or absence of leading and trailing zeros in numbers, the use or non-use of \u escapes in strings, *and the order of key/value pairs in objects*. So if your program depends on the order of key/value pairs, you cannot trust JSON-handling software you have not writtern yourself to preserve your extra semantics. That?s what I mean by ?risky?. For reasons having to to with compressibility, I?d probably use {?fields? : [?f1?,..,?fn?], ?values? : [v1, .., vn ] } if I wanted safe interoperability with 3rd-party JSON support. > From erantapaa at gmail.com Thu Dec 18 04:41:25 2014 From: erantapaa at gmail.com (Erik Rantapaa) Date: Wed, 17 Dec 2014 22:41:25 -0600 Subject: [Haskell-cafe] building hmatrix on OSX In-Reply-To: References: Message-ID: Thanks for prompting me to look for the issue tracker for hmatrix. I found it here: https://github.com/albertoruiz/hmatrix/issues and my problem is known and is actively being worked on: https://github.com/albertoruiz/hmatrix/issues/100 On Wed, Dec 17, 2014 at 6:59 PM, Carter Schonwald wrote: > did you file a bug report on the hmatrix issue tracker? You'll probably get > good support there > > On Wed, Dec 17, 2014 at 2:43 PM, Erik Rantapaa wrote: >> >> I'm trying to build hmatrix-0.16.1.1 on OSX 10.10.1, and I'm running into >> some undefined C functions and types in src/C/vector-aux.c: >> >> - struct random_data >> - random_r() >> - initstate_r() >> >> A specific error: >> >> src/C/vector-aux.c:738:24: >> error: variable has incomplete type 'struct random_data' >> struct random_data buffer; >> >> On a Linux system they seem to be defined in stdlib.h, but that doesn't >> seem to be the case on OSX. >> >> Is there a way to work around this? >> >> FWIW, I'm using GHC for OSX (https://ghcformacosx.github.io/) and I've >> installed `gsl` via `brew install gsl`. >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > From J.T.Jeuring at uu.nl Thu Dec 18 07:32:13 2014 From: J.T.Jeuring at uu.nl (Johan Jeuring) Date: Thu, 18 Dec 2014 08:32:13 +0100 Subject: [Haskell-cafe] CFP: TFPIE 2015 Message-ID: Trends in Functional Programming in Education (TFPIE 2015) Call for papers https://wiki.science.ru.nl/tfpie/TFPIE2015 The 4th International Workshop on Trends in Functional Programming in Education, TFPIE 2015, will be held on June 2, 2015 in Sophia-Antipolis in France. It is co-located with the Symposium on Trends in Functional Programming (TFP 2015) which takes place from June 3 - 5. *** Goal *** The goal of TFPIE is to gather researchers, teachers and professionals that use, or are interested in the use of, functional programming in education. TFPIE aims to be a venue where novel ideas, classroom-tested ideas and work-in-progress on the use of functional programming in education are discussed. The one-day workshop will foster a spirit of open discussion by having a review process for publication after the workshop. The program chair of TFPIE 2015 will screen submissions to ensure that all presentations are within scope and are of interest to participants. Potential presenters are invited to submit an extended abstract (4-6 pages) or a draft paper (up to 16 pages) in EPTCS style. The authors of accepted presentations will have their preprints and their slides made available on the workshop's website/wiki. Visitors to the TFPIE 2015 website/wiki will be able to add comments. This includes presenters who may respond to comments and questions as well as provide pointers to improvements and follow-up work. After the workshop, presenters will be invited to submit (a revised version of) their article for review. The PC will select the best articles for publication in the journal Electronic Proceedings in Theoretical Computer Science (EPTCS). Articles rejected for presentation and extended abstracts will not be formally reviewed by the PC. TFPIE workshops have previously been held in St Andrews, Scotland (2012), Provo Utah, USA (2013), and Soesterberg, The Netherlands (2014). *** Program Committee *** Peter Achten, Radboud University Nijmegen, The Netherlands Edwin Brady, University of St Andrews, UK Johan Jeuring, Utrecht University and Open University, The Netherlands (Chair) Shriram Krishnamurthi, Brown University, US Rita Loogen, Philipps-Universit?t Marburg, Germany Marco Morazan, Seton Hall University, US Norman Ramsey, Tufts University, US *** Submission Guidelines *** TFPIE 2015 welcomes submissions describing techniques used in the classroom, tools used in and/or developed for the classroom and any creative use of functional programming (FP) to aid education in or outside Computer Science. Topics of interest include, but are not limited to: - FP and beginning CS students - FP and Computational Thinking - FP and Artificial Intelligence - FP in Robotics - FP and Music - Advanced FP for undergraduates - Tools supporting learning FP - FP in graduate education - Engaging students in research using FP - FP in Programming Languages - FP in the high school curriculum - FP as a stepping stone to other CS topics - FP and Philosophy *** Best Lectures *** In addition to papers, we request ?best lecture? presentations. What is your best lecture topic in an FP related course? Do you have a fun way to present FP concepts to novices or perhaps an especially interesting presentation of a difficult topic? In either case, please consider sharing it. Best lecture topics will be selected for presentation based on a short abstract describing the lecture and its interest to TFPIE attendees. *** Submission *** Papers and abstracts can be submitted via easychair at the following link: https://easychair.org/conferences/?conf=tfpie2015 It is expected at at least one author for each submitted paper will attend the workshop. *** Important Dates *** April 7, 2015: Early Registration for TFP closes April 27, 2015: Submission deadline for draft TFPIE papers and abstracts May 3 2015: Notification of acceptance for presentation ?? (Probably May 22 2015): Registration for TFPIE closes - as does late registration for TFP June 2, 2015: Presentations in Sophia-Antipolis, France July 7, 2015: Full papers for EPTCS proceedings due. September 1, 2015: Notification of acceptance for proceedings September 22, 2015: Camera ready copy due for EPTCS Submission of an abstract implies no obligation to submit a full version; abstracts with no corresponding full versions by the full paper deadline will be considered as withdrawn. From apfelmus at quantentunnel.de Thu Dec 18 09:59:11 2014 From: apfelmus at quantentunnel.de (Heinrich Apfelmus) Date: Thu, 18 Dec 2014 10:59:11 +0100 Subject: [Haskell-cafe] Why does Haskell PVP have two values for the major version? "A.B..." and a couple other questions In-Reply-To: References: Message-ID: Johan Tibell wrote: > Zach Moazeni wrote: >> Another question, by far most packages I have encountered either lead with >> a 0 or a 1 for "A". Does that have some bearing on the long term stability >> that package users should expect in the future? > > This is something that happens a lot in open source, in Haskell or > elsewhere. We programmers are afraid of calling something 1.0, because > that somehow means "done", which we never (think we) are. :) Lots of really > stable Haskell libraries (e.g. containers) are still on version 0.X. I think the original motivation for major versions of the form A.B was, at least for me, that preliminary versions can be indicated by A=0. Personally, I don't consider 1.0 to be "done". Rather version "1.0" means that the core functionality has been implemented and that the package authors now have an idea what the core API should look like -- up to future changes. Thus, I think containers perfectly well deserves version 1.0. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com From alfredo.dinapoli at gmail.com Thu Dec 18 10:08:52 2014 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Thu, 18 Dec 2014 11:08:52 +0100 Subject: [Haskell-cafe] CFP: TFPIE 2015 In-Reply-To: References: Message-ID: Good morning Johan, I was just looking at the Wiki and it seems quite interesting, even though I would like to ask you something as this passage is open to multiple interpretations: "TFPIE 2015 welcomes submissions describing techniques used in the classroom, tools used in and/or developed for the classroom and any creative use of functional programming (FP) to aid education in or outside Computer Science." What I would like to understand is if the focus of the Workshop is on "Teaching students FP" or is rather "Using FP to built products to aid teaching/learning". Or perhaps is a sprinkle of both? We (Iris Connect Ltd - www.irisconnect.co.uk) are a company which have recently rebuilt all our backend systems in Haskell, and we do sell a product which is basically a web platform for teachers to share, collaborate and develop best practices. So, technically speaking, we indeed have developed a tool/product using FP and we are in the education market, but we do not certainly teach functional programming to students. Speaking hypothetically, would we be accepted to the workshop is this is just too "out of focus"? I hope I have conveyed my ideas clearly enough. My best regards, Alfredo Di Napoli On 18 December 2014 at 08:32, Johan Jeuring wrote: > > Trends in Functional Programming in Education (TFPIE 2015) > Call for papers > https://wiki.science.ru.nl/tfpie/TFPIE2015 > > The 4th International Workshop on Trends in Functional Programming in > Education, > TFPIE 2015, will be held on June 2, 2015 in Sophia-Antipolis in France. It > is > co-located with the Symposium on Trends in Functional Programming (TFP > 2015) > which takes place from June 3 - 5. > > *** Goal *** > > The goal of TFPIE is to gather researchers, teachers and professionals > that use, > or are interested in the use of, functional programming in education. > TFPIE aims > to be a venue where novel ideas, classroom-tested ideas and > work-in-progress on > the use of functional programming in education are discussed. The one-day > workshop will foster a spirit of open discussion by having a review > process for > publication after the workshop. The program chair of TFPIE 2015 will screen > submissions to ensure that all presentations are within scope and are of > interest to participants. Potential presenters are invited to submit an > extended > abstract (4-6 pages) or a draft paper (up to 16 pages) in EPTCS style. The > authors of accepted presentations will have their preprints and their > slides > made available on the workshop's website/wiki. Visitors to the TFPIE 2015 > website/wiki will be able to add comments. This includes presenters who may > respond to comments and questions as well as provide pointers to > improvements > and follow-up work. After the workshop, presenters will be invited to > submit (a > revised version of) their article for review. The PC will select the best > articles for publication in the journal Electronic Proceedings in > Theoretical > Computer Science (EPTCS). Articles rejected for presentation and extended > abstracts will not be formally reviewed by the PC. TFPIE workshops have > previously been held in St Andrews, Scotland (2012), Provo Utah, USA > (2013), and > Soesterberg, The Netherlands (2014). > > *** Program Committee *** > > Peter Achten, Radboud University Nijmegen, The Netherlands > Edwin Brady, University of St Andrews, UK > Johan Jeuring, Utrecht University and Open University, The Netherlands > (Chair) > Shriram Krishnamurthi, Brown University, US > Rita Loogen, Philipps-Universit?t Marburg, Germany > Marco Morazan, Seton Hall University, US > Norman Ramsey, Tufts University, US > > *** Submission Guidelines *** > > TFPIE 2015 welcomes submissions describing techniques used in the > classroom, > tools used in and/or developed for the classroom and any creative use of > functional programming (FP) to aid education in or outside Computer > Science. > Topics of interest include, but are not limited to: > > - FP and beginning CS students > - FP and Computational Thinking > - FP and Artificial Intelligence > - FP in Robotics > - FP and Music > - Advanced FP for undergraduates > - Tools supporting learning FP > - FP in graduate education > - Engaging students in research using FP > - FP in Programming Languages > - FP in the high school curriculum > - FP as a stepping stone to other CS topics > - FP and Philosophy > > *** Best Lectures *** > > In addition to papers, we request ?best lecture? presentations. What is > your > best lecture topic in an FP related course? Do you have a fun way to > present FP > concepts to novices or perhaps an especially interesting presentation of a > difficult topic? In either case, please consider sharing it. Best lecture > topics > will be selected for presentation based on a short abstract describing the > lecture and its interest to TFPIE attendees. > > *** Submission *** > > Papers and abstracts can be submitted via easychair at the following link: > https://easychair.org/conferences/?conf=tfpie2015 > It is expected at at least one author for each submitted paper will attend > the > workshop. > > *** Important Dates *** > > April 7, 2015: Early Registration for TFP closes > April 27, 2015: Submission deadline for draft TFPIE papers and abstracts > May 3 2015: Notification of acceptance for presentation > ?? (Probably May 22 2015): Registration for TFPIE closes - as does late > registration for TFP > June 2, 2015: Presentations in Sophia-Antipolis, France > July 7, 2015: Full papers for EPTCS proceedings due. > September 1, 2015: Notification of acceptance for proceedings > September 22, 2015: Camera ready copy due for EPTCS > > Submission of an abstract implies no obligation to submit a full version; > abstracts with no corresponding full versions by the full paper deadline > will be > considered as withdrawn. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haskell at ibotty.net Thu Dec 18 11:39:04 2014 From: haskell at ibotty.net (Tobias Florek) Date: Thu, 18 Dec 2014 12:39:04 +0100 Subject: [Haskell-cafe] managing local cabal package database In-Reply-To: References: Message-ID: <20141218113904.9031.20504@x201> > Cabal allows to specify a directory for local packages ('local-repo' in '.cabal > /config') with specific structure. Are there any scripts that take a git repo, > checkout its tags one by one and put them in some specified directory in the > correct way? have a look at the bug report for cabal to support it. there are some pointers on how to do it manually. i don't have the script handy, but it is pretty trivial. cheers, tob(ias florek) From roma at ro-che.info Thu Dec 18 11:47:28 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Thu, 18 Dec 2014 13:47:28 +0200 Subject: [Haskell-cafe] managing local cabal package database In-Reply-To: References: <20141215090009.GA18274@machine> Message-ID: <5492BED0.1000006@ro-che.info> Consider using FP Complete's stackage server and snapshots. You can include different versions in different snapshots. http://bit.ly/1vNjqHV I use it at Signal Vine, and am very happy with it. On 15/12/14 14:34, Carl Eyeinsky wrote: > Hi Daniel (and other readers), > > > the use case is that if I have several versions of the private dependency. > > I.e I develop a project A, and after a while I find, that part of it > wold be useful to break out to another package, so I make a package X > and list it as dependencie. Here, 'add-source' works. BUT, some time > later I'm done with A, and start developing B, and include X as a > dependencie. Then, I find that X could use some improvements -- but > after these my project A probably breaks due to these changes. The > solution, of course, is versioning, but I think 'add-source' doesn't > help there anymore (right?), unless I copy the head to another directory > and do the improvements there. > > This last mentioned way (of leaving a trail of previous versions) is a > manual way of version management. What I was thinking of is that, is > there some paved solution available (short of running my own Hackage, > which some do, as I've been reading.) > > Sorry -- I should have been much more explicit! > > > Cheers, > > > On Mon, Dec 15, 2014 at 10:00 AM, Daniel Trstenjak > > wrote: > > > Hi Carl, > > > I'm wondering what do you guys use as the general method in developing projects > > using your own private projects? > > Using a 'cabal sandbox' and its command 'add-source' to add a local > library seems to be the way to go. > > > Greetings, > Daniel > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > -- > Carl Eyeinsky > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From holmisen at gmail.com Thu Dec 18 16:48:02 2014 From: holmisen at gmail.com (Johan Holmquist) Date: Thu, 18 Dec 2014 17:48:02 +0100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: <548CB1D8.80309@power.com.pl> References: <548AEA5E.1010906@power.com.pl> <548C37A5.7030800@plaimi.net> <548C6479.1090308@power.com.pl> <548CB1D8.80309@power.com.pl> Message-ID: There is (>>>) in Control.Arrow. It can be used for `flip ($)`. 2014-12-13 22:38 GMT+01:00 Wojtek Narczy?ski : > On 13.12.2014 18:16, David Feuer wrote: >> >> It all depends what "taken" means. Data.Sequence uses <| for cons and >> |> for snoc. That may not have been the best decision, but it was made >> a long time ago. > > Oops, I certainly didn't mean that for "not taken"... > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From holmisen at gmail.com Thu Dec 18 16:53:14 2014 From: holmisen at gmail.com (Johan Holmquist) Date: Thu, 18 Dec 2014 17:53:14 +0100 Subject: [Haskell-cafe] Missing `$` like operators in Haskell In-Reply-To: References: <548AEA5E.1010906@power.com.pl> <548C37A5.7030800@plaimi.net> <548C6479.1090308@power.com.pl> <548CB1D8.80309@power.com.pl> Message-ID: > There is (>>>) in Control.Arrow. It can be used for `flip ($)`. No, sorry. I was confusing it with flipped function composition. 2014-12-18 17:48 GMT+01:00 Johan Holmquist : > There is (>>>) in Control.Arrow. It can be used for `flip ($)`. > > 2014-12-13 22:38 GMT+01:00 Wojtek Narczy?ski : >> On 13.12.2014 18:16, David Feuer wrote: >>> >>> It all depends what "taken" means. Data.Sequence uses <| for cons and >>> |> for snoc. That may not have been the best decision, but it was made >>> a long time ago. >> >> Oops, I certainly didn't mean that for "not taken"... >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe From chrisdone at gmail.com Thu Dec 18 17:02:45 2014 From: chrisdone at gmail.com (Christopher Done) Date: Thu, 18 Dec 2014 18:02:45 +0100 Subject: [Haskell-cafe] Typed TH Message-ID: http://lpaste.net/116791 If someone feels like spending time exploring this and putting it in a library I will be interested in trying it. I saw some old work to patch GHC to do this including typed quotation of expressions, which doesn't seem to have arrived. Relatedly I made a trivial Lisp with untyped and typed quotation https://gist.github.com/chrisdone/516489f4f27846712225 It doesn't seem to be a much-explored area in the Lisp world, Haskell is treading new waters in some ways. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Thu Dec 18 17:43:14 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Thu, 18 Dec 2014 17:43:14 +0000 Subject: [Haskell-cafe] Typed TH In-Reply-To: References: Message-ID: <20141218174313.GC7757@weber> On Thu, Dec 18, 2014 at 06:02:45PM +0100, Christopher Done wrote: > http://lpaste.net/116791 > > If someone feels like spending time exploring this and putting it in a > library I will be interested in trying it. I saw some old work to patch GHC > to do this including typed quotation of expressions, which doesn't seem to > have arrived. This is a great idea and looks very useful, which raises the following question: Why hasn't this already been done? Is there some fundamental obstruction? Perhaps someone who has tried this has some wisdom to share. Tom From vogt.adam at gmail.com Thu Dec 18 18:40:49 2014 From: vogt.adam at gmail.com (adam vogt) Date: Thu, 18 Dec 2014 13:40:49 -0500 Subject: [Haskell-cafe] Typed TH In-Reply-To: <20141218174313.GC7757@weber> References: <20141218174313.GC7757@weber> Message-ID: On Thu, Dec 18, 2014 at 12:43 PM, Tom Ellis wrote: > This is a great idea and looks very useful, which raises the following > question: Why hasn't this already been done? Is there some fundamental > obstruction? Perhaps someone who has tried this has some wisdom to share. Sometimes I found myself using: foldl appE :: ExpQ -> [ExpQ] -> ExpQ If you try that with appE_, you end up with a type error "Occurs check: cannot construct the infinite type: t1 ~ t -> t1". It would type check if it was a foldl over a hlist, but I don't think that would be a preferred solution. Since appE_ doesn't work when you don't know how many times it will be used, I think people would just inline one possible definition: appE_ :: Q (TExp (a -> b)) -> Q (TExp a) -> Q (TExp b) appE_ f x = [|| $$f $$x ||] Secondly, it looks like you can only make a value of type "L String" by using stringL_, and only consume them with litE_, so I think that intermediate type does not really help. In other words, I think it is better to just use the following: liftString_ :: String -> Q (TExp String) liftString_ = litE_ . stringL_ or just inline the following more general function: lift_ :: Lift t => t -> Q (TExp t) lift_ x = [|| x ||] I don't see those extra functions providing something that the typed bracket / quotation syntax doesn't already provide in a prettier way. Regards, Adam From edwardamsden at gmail.com Thu Dec 18 19:10:13 2014 From: edwardamsden at gmail.com (Edward Amsden) Date: Thu, 18 Dec 2014 19:10:13 +0000 Subject: [Haskell-cafe] Typed TH References: <20141218174313.GC7757@weber> Message-ID: Relevant paper to typed quotation: http://repository.cmu.edu/cgi/viewcontent.cgi?article=2969&context=compsci I'm very interested in metaprogramming in typed languages, and this paper seems to suggest that it is a Hard Problem?. On Thu Dec 18 2014 at 1:41:07 PM adam vogt wrote: > On Thu, Dec 18, 2014 at 12:43 PM, Tom Ellis > wrote: > > This is a great idea and looks very useful, which raises the following > > question: Why hasn't this already been done? Is there some fundamental > > obstruction? Perhaps someone who has tried this has some wisdom to > share. > > Sometimes I found myself using: > > foldl appE :: ExpQ -> [ExpQ] -> ExpQ > > If you try that with appE_, you end up with a type error "Occurs > check: cannot construct the infinite type: t1 ~ t -> t1". It would > type check if it was a foldl over a hlist, but I don't think that > would be a preferred solution. Since appE_ doesn't work when you don't > know how many times it will be used, I think people would just inline > one possible definition: > > appE_ :: Q (TExp (a -> b)) -> Q (TExp a) -> Q (TExp b) > appE_ f x = [|| $$f $$x ||] > > Secondly, it looks like you can only make a value of type "L String" > by using stringL_, and only consume them with litE_, so I think that > intermediate type does not really help. In other words, I think it is > better to just use the following: > > liftString_ :: String -> Q (TExp String) > liftString_ = litE_ . stringL_ > > or just inline the following more general function: > > lift_ :: Lift t => t -> Q (TExp t) > lift_ x = [|| x ||] > > I don't see those extra functions providing something that the typed > bracket / quotation syntax doesn't already provide in a prettier way. > > > Regards, > Adam > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpaugh at gmx.us Thu Dec 18 18:19:21 2014 From: jpaugh at gmx.us (Jonathan Paugh) Date: Thu, 18 Dec 2014 18:19:21 +0000 Subject: [Haskell-cafe] Dockerfile for Yesod Message-ID: Greetings, all I'm brand new to Docker, and struggled to find resources specific to Yesod. So, once I managed to piece together a Dockerfile, I decided to share it. Hope it helps someone. The Dockerfile is pasted at the bottom. It can be used by dropping it in your Yesod application directory, and replacing "app" with the name of your app. If you're new to Docker like I was, cd to your Yesod app dir, and run $ docker build --tag app-image . $ docker run -d -p 3000:3000 app-image to get started. Your web app should now be available at http://localhost:3000 NB: The approot setting can make a profound and confusing difference if it is mis-configured. I recommend temporarily setting approot to "" so that it will use absolute (site-relative) urls instead of fully specified ones. Happy Holidays, Jon Dockerfile ----------- FROM haskell:7.8 RUN cabal update RUN apt-get update && apt-get install -y libpq5 libpq-dev ADD ./app.cabal /opt/app/app.cabal WORKDIR /opt/app RUN cabal sandbox init RUN cabal install --only-dependencies --max-backjumps=-1 --reorder-goals -j ADD . /opt/app RUN cabal build RUN dist/build/db-import/db-import ENV PATH /opt/app/.cabal-sandbox/bin:$PATH EXPOSE 3000 CMD ["/opt/app/dist/build/app/app", "production", "-p", "3000"] From kazu at iij.ad.jp Fri Dec 19 01:09:55 2014 From: kazu at iij.ad.jp (Kazu Yamamoto (=?iso-2022-jp?B?GyRCOzNLXE9CSScbKEI=?=)) Date: Fri, 19 Dec 2014 10:09:55 +0900 (JST) Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: References: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> Message-ID: <20141219.100955.923068519522497375.kazu@iij.ad.jp> Hi Manuel, I'm answering to you as a contributor of HRR. > It looks like this project shares many goals with Tom Ellis? excellent > and recently released[1] Opaleye library. How would you say your > approach compares with Opaleye?s? We got to know Opaleye just before we released HRR. We have not compared HRR with Opaleye yet. They are really independent. To be fair, would you enumerate technical questions? We would love to answer. And it would be nice if Tom will answer to them, too. P.S. HRR has been already used in the backend systems to express complex SQLs in Asahi-Net (an ISP in Japan) more than one year. It's not a toy package. Regards, --Kazu From guillaumh at gmail.com Fri Dec 19 01:33:49 2014 From: guillaumh at gmail.com (Guillaume Hoffmann) Date: Thu, 18 Dec 2014 22:33:49 -0300 Subject: [Haskell-cafe] gracefully invoking `less` using System.Process (andignoring ctrl-c) In-Reply-To: References: <20141212181903.9D0CC276C52@mail.avvanta.com> Message-ID: Thanks Donn, I tried with process-1.2.0.0 and the delegate_ctlc option and now the behaviour is correct :-) From rendel at informatik.uni-tuebingen.de Fri Dec 19 01:56:41 2014 From: rendel at informatik.uni-tuebingen.de (Tillmann Rendel) Date: Fri, 19 Dec 2014 02:56:41 +0100 Subject: [Haskell-cafe] Typed TH In-Reply-To: References: <20141218174313.GC7757@weber> Message-ID: <549385D9.3090203@informatik.uni-tuebingen.de> Hi, Edward Amsden wrote: > Relevant paper to typed quotation: > http://repository.cmu.edu/cgi/viewcontent.cgi?article=2969&context=compsci > > I'm very interested in metaprogramming in typed languages, and this > paper seems to suggest that it is a Hard Problem?. You mention Pfenning and Lee (1989) above. If you want to read more about this, there has been some progress in the tradition of that paper in recent years, including: Carette, Kiselyov, and Shan (2009). Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. Journal of Functional Programming 19(4): 509-543. (Extended version of a 2007 conference paper). Rendel, Ostermann, and Hofer (2009). Typed self-representation. In Proc. of PLDI. Jay and Palsberg (2011). Typed self-interpretation by pattern matching. In Proc. of ICFP. Brown and Palsberg (2015). Self-representation in Girard's System U. To appear in Proc. of POPL. These papers explore various tricks to avoid the fundamental hardness of expressing the rules of a sane type system in the same type system itself. For our own work on typed self-representation, we always hoped that it would lead to better macro systems for statically typed languages, but so far, we never figured out how to make it practical enough. I fear the situation is similar for the other papers. There's also work in the dependently typed community about reflection and meta-programming in dependently typed languages, such as: Chapman, Dagand, McBride, and Morris (2010). The gentle art of levitation. In Proc. of ICFP. and various others. Tillmann From fumiexcel at gmail.com Fri Dec 19 03:25:32 2014 From: fumiexcel at gmail.com (Fumiaki Kinoshita) Date: Fri, 19 Dec 2014 12:25:32 +0900 Subject: [Haskell-cafe] [ANN]Haskell Rhythm game development tutorial Message-ID: Hello, I've published a tutorial[0] to create a rhythm game. This tutorial focuses on the design of interactive, real-time application using lens, objective, Call package. Feel free to point out infelicities or offer suggestion. Cheers [0] http://fumieval.github.io/rhythm-game-tutorial/ -- Fumiaki Kinoshita -------------- next part -------------- An HTML attachment was scrubbed... URL: From ex8k.hibino at gmail.com Fri Dec 19 03:39:01 2014 From: ex8k.hibino at gmail.com (Kei Hibino) Date: Fri, 19 Dec 2014 12:39:01 +0900 (JST) Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: References: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> Message-ID: <20141219.123901.2041677716305014953.ex8k.hibino@gmail.com> From: Manuel G?mez Subject: Re: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL Date: Sun, 14 Dec 2014 12:22:25 -0430 > On Sun, Dec 14, 2014 at 12:04 PM, Kei Hibino wrote: >> I am happy to announce relational-record library and its project page. >> >> relational-record is domain specific language for type-safe SQL query building, >> and database access API with compile time schema generators. > > Congratulations on the release! It?s great to see more and more > interesting abstractions for relational databases in the Haskell > ecosystem. > > It looks like this project shares many goals with Tom Ellis? excellent > and recently released[1] Opaleye library. How would you say your > approach compares with Opaleye?s? > > [1]: > Relational Record and Opaleye resembles in approach of building not aggregated SQL query. Opaleye's method using arrow notation is very cool. So I try thin wrapper using Kleisli arrow. https://gist.github.com/khibino/57405584b168d98fd1e8 If not arrow version is like below, > personAndJoin :: QuerySimple (Projection Flat (Person, Birthday)) > personAndJoin = do > p <- query person > b <- query birthday > wheres $ p ! Person.name' .=. b ! Birthday.name' > return $ p >< b Arrow version is like this with this wrapper. > personAndJoinA :: QuerySimple () (Projection Flat (Person, Birthday)) > personAndJoinA = proc () -> do > p <- query -< person > b <- query -< birthday > wheres -< p ! Person.name' .=. b ! Birthday.name' > returnA -< p >< b Aggregation approaches differ. Relational Record accumulates aggregated context into monad stack, and Opaleye does not. Relational Record basically accumulates various query state into monad stack like join product, group keys and ordering. From magicloud.magiclouds at gmail.com Fri Dec 19 03:52:48 2014 From: magicloud.magiclouds at gmail.com (Magicloud Magiclouds) Date: Fri, 19 Dec 2014 11:52:48 +0800 Subject: [Haskell-cafe] Could someone help me to understand funB? Message-ID: Hi, Following code is to get a list of primes. Now it is hard for me to understand funB. I mean I can see what it does. But I cannot see the detailed process by every language part. import Control.Monad isPrime :: Integer -> Bool isPrime i = ap funA funB i funA :: Integer -> [Integer] -> Bool funA x xs = all (\x' -> (mod x x') /= 0) xs funB :: Integer -> [Integer] funB = flip takeWhile primes . ( . join (*)) . flip (<=) primes :: [Integer] primes = 2 : filter isPrime [3, 5 ..] main :: IO () main = print $ take 10 primes -- ??????? ??????? And for G+, please use magiclouds#gmail.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maydwell at gmail.com Fri Dec 19 04:32:24 2014 From: maydwell at gmail.com (Lyndon Maydwell) Date: Fri, 19 Dec 2014 15:32:24 +1100 Subject: [Haskell-cafe] Could someone help me to understand funB? In-Reply-To: References: Message-ID: funB = flip takeWhile primes . ( . join (*)) . flip (<=) funB x = flip takeWhile primes ((( . join (*)) . flip (<=)) x) funB x = takeWhile ((( . join (*)) . flip (<=)) x) primes funB x = takeWhile (foo x) primes foo x = (( . join (*)) . flip (<=)) x foo x = (( . join (*)) (flip (<=) x) foo x = flip (<=) x . join (*) foo x = (x <=) . join (*) -- join :: Monad m => m (m a) -> m a -- join (*) == (**2) foo x = (x <=) . (** 2) foo x y = x <= (y ** 2) isLessThanTheSquareOf = foo funB x = takeWhile (x `isLessThanTheSquareOf`) primes Helpful? On Fri, Dec 19, 2014 at 2:52 PM, Magicloud Magiclouds < magicloud.magiclouds at gmail.com> wrote: > > Hi, > > Following code is to get a list of primes. Now it is hard for me to > understand funB. I mean I can see what it does. But I cannot see the > detailed process by every language part. > > import Control.Monad > > isPrime :: Integer -> Bool > isPrime i = ap funA funB i > > funA :: Integer -> [Integer] -> Bool > funA x xs = all (\x' -> (mod x x') /= 0) xs > > funB :: Integer -> [Integer] > funB = flip takeWhile primes . ( . join (*)) . flip (<=) > > primes :: [Integer] > primes = 2 : filter isPrime [3, 5 ..] > > main :: IO () > main = print $ take 10 primes > > -- > ??????? > ??????? > > And for G+, please use magiclouds#gmail.com. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From magicloud.magiclouds at gmail.com Fri Dec 19 04:35:48 2014 From: magicloud.magiclouds at gmail.com (Magicloud Magiclouds) Date: Fri, 19 Dec 2014 12:35:48 +0800 Subject: [Haskell-cafe] Could someone help me to understand funB? In-Reply-To: References: Message-ID: Thank you. This will take some time for me to read. On Fri, Dec 19, 2014 at 12:32 PM, Lyndon Maydwell wrote: > > funB = flip takeWhile primes . ( . join (*)) . flip (<=) > > funB x = flip takeWhile primes ((( . join (*)) . flip (<=)) x) > > funB x = takeWhile ((( . join (*)) . flip (<=)) x) primes > > funB x = takeWhile (foo x) primes > > > foo x = (( . join (*)) . flip (<=)) x > > foo x = (( . join (*)) (flip (<=) x) > > foo x = flip (<=) x . join (*) > > foo x = (x <=) . join (*) > > > -- join :: Monad m => m (m a) -> m a > -- join (*) == (**2) > > foo x = (x <=) . (** 2) > > foo x y = x <= (y ** 2) > > isLessThanTheSquareOf = foo > > funB x = takeWhile (x `isLessThanTheSquareOf`) primes > > > Helpful? > > > On Fri, Dec 19, 2014 at 2:52 PM, Magicloud Magiclouds < > magicloud.magiclouds at gmail.com> wrote: > >> Hi, >> >> Following code is to get a list of primes. Now it is hard for me to >> understand funB. I mean I can see what it does. But I cannot see the >> detailed process by every language part. >> >> import Control.Monad >> >> isPrime :: Integer -> Bool >> isPrime i = ap funA funB i >> >> funA :: Integer -> [Integer] -> Bool >> funA x xs = all (\x' -> (mod x x') /= 0) xs >> >> funB :: Integer -> [Integer] >> funB = flip takeWhile primes . ( . join (*)) . flip (<=) >> >> primes :: [Integer] >> primes = 2 : filter isPrime [3, 5 ..] >> >> main :: IO () >> main = print $ take 10 primes >> >> -- >> ??????? >> ??????? >> >> And for G+, please use magiclouds#gmail.com. >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> -- ??????? ??????? And for G+, please use magiclouds#gmail.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From oleg at okmij.org Fri Dec 19 04:58:46 2014 From: oleg at okmij.org (oleg at okmij.org) Date: Thu, 18 Dec 2014 23:58:46 -0500 (EST) Subject: [Haskell-cafe] Typed TH Message-ID: <20141219045846.6C9CAC3829@www1.g3.pair.com> Typed meta-programming has a very rich history. For a good overview of various approaches and main problems, please see the Related work section of the following paper http://okmij.org/ftp/tagless-final/TaglessStaged/beyond-journal.pdf There is a special subsection on Typed TH. (The version of that paper with minor revisions will be uploaded in two-three months). The main problems are how to ensure hygiene in the presence of effects, and how to generate polymorphic bindings (let-bindings). Both problems have been essentially solved. (The solution to the second problem has been presented at small meetings so far). The paper explains the combinator library to generate TH code that is ensured to be well-typed, *by construction*. The library permits arbitrary monadic effects. There is no Q monad since it turns out not necessary. From ram at rkrishnan.org Fri Dec 19 08:32:40 2014 From: ram at rkrishnan.org (Ramakrishnan Muthukrishnan) Date: Fri, 19 Dec 2014 14:02:40 +0530 Subject: [Haskell-cafe] cabal-install on openbsd Message-ID: <1418977960.2132494.204756089.7A784A09@webmail.messagingengine.com> Hi, I have a new OpenBSD 5.6 installation on AMD64. The OpenBSD package collection has ghc 7.6.3 and Cabal-install 1.16.0.2. After installing them, I attempted to install a new version of cabal-install using the packaged cabal-install by doing `cabal install cabal-install'. But I get a "ghc: out of memory (requested 1048576 bytes)" error while it is compiling cabal-install 1.20.0.3. I have a ticket created against ghc but I wonder if it is a bug with ghc or cabal-install or OpenBSD or something else. Anyway.. the ticket is here [1]. I can help debug the problem on my OpenBSD box. Thanks Ramakrishnan [1] From ram at rkrishnan.org Fri Dec 19 10:43:49 2014 From: ram at rkrishnan.org (Ramakrishnan Muthukrishnan) Date: Fri, 19 Dec 2014 16:13:49 +0530 Subject: [Haskell-cafe] cabal-install on openbsd In-Reply-To: <241b5299-f0b9-4bd7-9862-8b4dcd03fd90@googlegroups.com> References: <1418977960.2132494.204756089.7A784A09@webmail.messagingengine.com> <241b5299-f0b9-4bd7-9862-8b4dcd03fd90@googlegroups.com> Message-ID: <1418985829.726509.204789277.09CA7137@webmail.messagingengine.com> On Fri, Dec 19, 2014, at 03:47 PM, Gusoi Constantin - Codrut wrote: > I have the same problem on Ubunutu 14.04, what you need to do is to > use more RAM / SWAP. I have 1 GB of swap. I still get the error. The allocation error is for 1 MegaByte (1048576 bytes). That's what make me really surprised. May be it runs out of memory and fails when it cannot allocate one more megabyte of memory? Ramakrishnan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Fri Dec 19 12:44:36 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Fri, 19 Dec 2014 12:44:36 +0000 Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: <20141219.123901.2041677716305014953.ex8k.hibino@gmail.com> References: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> <20141219.123901.2041677716305014953.ex8k.hibino@gmail.com> Message-ID: <20141219124436.GA20224@weber> On Fri, Dec 19, 2014 at 12:39:01PM +0900, Kei Hibino wrote: > From: Manuel G?mez > Subject: Re: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL > Date: Sun, 14 Dec 2014 12:22:25 -0430 > > > On Sun, Dec 14, 2014 at 12:04 PM, Kei Hibino wrote: > >> I am happy to announce relational-record library and its project page. > >> > >> relational-record is domain specific language for type-safe SQL query building, > >> and database access API with compile time schema generators. > > > > Congratulations on the release! It?s great to see more and more > > interesting abstractions for relational databases in the Haskell > > ecosystem. > > > > It looks like this project shares many goals with Tom Ellis? excellent > > and recently released[1] Opaleye library. How would you say your > > approach compares with Opaleye?s? > > > > [1]: > > Relational Record and Opaleye resembles in approach of building > not aggregated SQL query. > > Opaleye's method using arrow notation is very cool. Opaleye uses arrows only because it is hard to implement a sensible semantics otherwise. See, for example, this bug report on HaskellDB which used a monad rather than an arrow https://github.com/m4dc4p/haskelldb/issues/22 Tom From rasfar at gmail.com Fri Dec 19 13:07:33 2014 From: rasfar at gmail.com (Andrew Seniuk) Date: Fri, 19 Dec 2014 07:07:33 -0600 Subject: [Haskell-cafe] ANN: deepseq-bounded, seqaid, leaky Message-ID: This trio of related packages explores strictness control in a variety of ways. deepseq-bounded provides classes and generic functions to artificially force evaluation, to extents controlled by static or dynamic configuration. seqaid puts that into practise, providing a GHC plugin to auto-instrument your package with a strictness harness, which is dynamically optimisable during runtime. This is supported directly in the GHC compilation pipeline, without requiring (or performing!) any edits to your sources. leaky is a minimal, prototypic executable that leaks space under current state-of-the-art compilation (GHC 7.8.3 -O2, at the present time). deepseq-bounded hackage: https://hackage.haskell.org/package/deepseq-bounded homepage: http://www.fremissant.net/deepseq-bounded seqaid hackage: https://hackage.haskell.org/package/seqaid homepage: http://www.fremissant.net/seqaid leaky hackage: https://hackage.haskell.org/package/leaky homepage: http://www.fremissant.net/leaky Reddit discussion for the three together: http://www.reddit.com/r/haskell/comments/2ps8f5/ann_deepseqbounded_seqaid_leaky/ Easiest way to try them all, is to install seqaid and run the demo: cabal install seqaid seqaid demo This tests seqaid on a local copy of the leaky source package. It turned out to be routine to extend deepseq-bounded and seqaid to dynamically configurable parallelisation (paraid?). Many other wrappers could be explored, too! Maybe seqaid should be renamed to koolaid or something... It's a pretty complicated system, and just first release, so there's bound to be lots of problems. I've not set up a bug tracker, but will maintain a casual list of bugs and feature requests at http://www.fremissant.net/seqaid/trac and will set up a proper tracker if there's interest. Any isssues (or comments), I'm here, or on the reddit discussion (or email). Andrew Seniuk rasfar on #haskell -------------- next part -------------- An HTML attachment was scrubbed... URL: From rasfar at gmail.com Fri Dec 19 14:01:12 2014 From: rasfar at gmail.com (Andrew Seniuk) Date: Fri, 19 Dec 2014 08:01:12 -0600 Subject: [Haskell-cafe] ANN: deepseq-bounded, seqaid, leaky In-Reply-To: References: Message-ID: Sorry, that was my first Reddit post and I messed up. Please use this link http://www.reddit.com/r/haskell/comments/2pscxh/ann_deepseqbounded_seqaid_leaky/ -Andrew On Fri, Dec 19, 2014 at 7:07 AM, Andrew Seniuk wrote: > This trio of related packages explores strictness control in a variety of > ways. > > deepseq-bounded provides classes and generic functions to artificially > force evaluation, to extents controlled by static or dynamic configuration. > > seqaid puts that into practise, providing a GHC plugin to auto-instrument > your package with a strictness harness, which is dynamically optimisable > during runtime. This is supported directly in the GHC compilation > pipeline, without requiring (or performing!) any edits to your sources. > > leaky is a minimal, prototypic executable that leaks space under current > state-of-the-art compilation (GHC 7.8.3 -O2, at the present time). > > deepseq-bounded > hackage: https://hackage.haskell.org/package/deepseq-bounded > homepage: http://www.fremissant.net/deepseq-bounded > > seqaid > hackage: https://hackage.haskell.org/package/seqaid > homepage: http://www.fremissant.net/seqaid > > leaky > hackage: https://hackage.haskell.org/package/leaky > homepage: http://www.fremissant.net/leaky > > Reddit discussion for the three together: > > http://www.reddit.com/r/haskell/comments/2ps8f5/ann_deepseqbounded_seqaid_leaky/ > > Easiest way to try them all, is to install seqaid and run the demo: > > cabal install seqaid > seqaid demo > > This tests seqaid on a local copy of the leaky source package. > > It turned out to be routine to extend deepseq-bounded and seqaid to > dynamically configurable parallelisation (paraid?). Many other wrappers > could be explored, too! Maybe seqaid should be renamed to koolaid or > something... > > It's a pretty complicated system, and just first release, so there's bound > to be lots of problems. I've not set up a bug tracker, but will maintain a > casual list of bugs and feature requests at > > http://www.fremissant.net/seqaid/trac > > and will set up a proper tracker if there's interest. > > Any isssues (or comments), I'm here, or on the reddit discussion (or > email). > > Andrew Seniuk > rasfar on #haskell > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anton.dessiatov at gmail.com Fri Dec 19 15:46:04 2014 From: anton.dessiatov at gmail.com (Anton Dessiatov) Date: Fri, 19 Dec 2014 21:46:04 +0600 Subject: [Haskell-cafe] GHC Heap Profiler time axis Message-ID: <50CE692070C9494FA5C40C5F2B54865E@futurama.local> Hello, Haskell-Cafe! For the last 2 days I?m debugging something that looks like a space leak. My program is a rather long-running network service. When I first used heap profiler I was a bit confused with its output that showed that my program was running for only about 0.3-0.4 seconds when I launched it idling for about a minute. That was confusing enough for me to dig into GHC sources trying to figure out the reason behind this and I found that values of the sample times are taken from the mut_user_time function, which returns a time that process spent in user-mode code (outside the kernel) minus time spent on garbage collection. This introduces great amount of unpredictable non-linearity of the heap profile graph x axis, which I personally consider very counterintuitive. So my question is does anybody know why is it done this way? Wouldn?t it be better if x axis would just show a time elapsed since the process started? Kind regards, Anton. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jgbailey at gmail.com Fri Dec 19 16:07:39 2014 From: jgbailey at gmail.com (Justin Bailey) Date: Fri, 19 Dec 2014 08:07:39 -0800 Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: <20141219124436.GA20224@weber> References: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> <20141219.123901.2041677716305014953.ex8k.hibino@gmail.com> <20141219124436.GA20224@weber> Message-ID: On Fri, Dec 19, 2014 at 4:44 AM, Tom Ellis wrote: > Opaleye uses arrows only because it is hard to implement a sensible > semantics otherwise. See, for example, this bug report on HaskellDB which > used a monad rather than an arrow > I'm curious how arrows make it easier to deal with aggregation? Sounds pretty interesting ... Justin From fuuzetsu at fuuzetsu.co.uk Fri Dec 19 16:26:52 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Fri, 19 Dec 2014 16:26:52 +0000 Subject: [Haskell-cafe] GHC Heap Profiler time axis In-Reply-To: <50CE692070C9494FA5C40C5F2B54865E@futurama.local> References: <50CE692070C9494FA5C40C5F2B54865E@futurama.local> Message-ID: <549451CC.2040402@fuuzetsu.co.uk> On 12/19/2014 03:46 PM, Anton Dessiatov wrote: > Hello, Haskell-Cafe! > > For the last 2 days I?m debugging something that looks like a space > leak. My program is a rather long-running network service. When I > first used heap profiler I was a bit confused with its output that > showed that my program was running for only about 0.3-0.4 seconds > when I launched it idling for about a minute. > > That was confusing enough for me to dig into GHC sources trying to > figure out the reason behind this and I found that values of the > sample times are taken from the mut_user_time function, which returns > a time that process spent in user-mode code (outside the kernel) > minus time spent on garbage collection. > > This introduces great amount of unpredictable non-linearity of the > heap profile graph x axis, which I personally consider very > counterintuitive. > > So my question is does anybody know why is it done this way? Wouldn?t > it be better if x axis would just show a time elapsed since the > process started? > > Kind regards, Anton. > > ghc-user or ghc-devs lists may be more appropriate for this question. I am eager to find out myself. -- Mateusz K. From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Fri Dec 19 16:29:15 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Fri, 19 Dec 2014 16:29:15 +0000 Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: References: <20141215.013407.330292040331320869.ex8k.hibino@gmail.com> <20141219.123901.2041677716305014953.ex8k.hibino@gmail.com> <20141219124436.GA20224@weber> Message-ID: <20141219162915.GC20224@weber> On Fri, Dec 19, 2014 at 08:07:39AM -0800, Justin Bailey wrote: > On Fri, Dec 19, 2014 at 4:44 AM, Tom Ellis > wrote: > > Opaleye uses arrows only because it is hard to implement a sensible > > semantics otherwise. See, for example, this bug report on HaskellDB which > > used a monad rather than an arrow > > I'm curious how arrows make it easier to deal with aggregation? Sounds > pretty interesting ... They don't make it "easier" to deal with aggregation, they just avoid some cases you don't want to have to implement. HaskellDB allows you to write a function like groupByAndSum :: (Expr String, Expr Int) -> Query (Expr String, Expr Int) and it is hard or impossible to give this sensible semantics in SQL. (The function you get doesn't have exactly this type because of HaskellDB's home-rolled record types, but it is effectively this). Arrows help avoid this. (Interestingly Postgres's recent LATERAL JOIN FEATURE may make the above possible.) Tom From fuuzetsu at fuuzetsu.co.uk Fri Dec 19 16:36:04 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Fri, 19 Dec 2014 16:36:04 +0000 Subject: [Haskell-cafe] [ANN]Haskell Rhythm game development tutorial In-Reply-To: References: Message-ID: <549453F4.10202@fuuzetsu.co.uk> On 12/19/2014 03:25 AM, Fumiaki Kinoshita wrote: > Hello, > > I've published a tutorial[0] to create a rhythm game. This tutorial focuses > on the design of interactive, real-time application using lens, objective, > Call package. > > Feel free to point out infelicities or offer suggestion. > > Cheers > > [0] http://fumieval.github.io/rhythm-game-tutorial/ > > -- > Fumiaki Kinoshita > > Hopefully I can find time to port my rhythm game to call soon. A small comment: ?unsafePerformIO? seems inappropriate to use without explanation in any kind of tutorial. Maybe point out that it's there for simplicity only. I also wonder whether you considered using TemplateHaskell to inline resources at compile time: this allows us to produce a neat binary without data files lying around which may sometimes be desirable. -- Mateusz K. From P.Achten at cs.ru.nl Fri Dec 19 16:49:23 2014 From: P.Achten at cs.ru.nl (Peter Achten) Date: Fri, 19 Dec 2014 17:49:23 +0100 Subject: [Haskell-cafe] [TFP 2015] 1st call for papers Message-ID: <54945713.3070602@cs.ru.nl> ----------------------------- C A L L F O R P A P E R S ----------------------------- ======== TFP 2015 =========== 16th Symposium on Trends in Functional Programming June 3-5, 2015 Inria Sophia Antipolis, France http://tfp2015.inria.fr/ The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming, taking a broad view of current and future trends in the area. It aspires to be a lively environment for presenting the latest research results, and other contributions (see below). Authors of draft papers will be invited to submit revised papers based on the feedback receive at the symposium. A post-symposium refereeing process will then select a subset of these articles for formal publication. The selected revised papers are expected to be published as a Springer Lecture Notes in Computer Science (LNCS) volume. TFP 2015 will be the main event of a pair of functional programming events. TFP 2015 will be accompanied by the International Workshop on Trends in Functional Programming in Education (TFPIE), which will take place on June 2nd. The TFP symposium is the heir of the successful series of Scottish Functional Programming Workshops. Previous TFP symposia were held in * Edinburgh (Scotland) in 2003; * Munich (Germany) in 2004; * Tallinn (Estonia) in 2005; * Nottingham (UK) in 2006; * New York (USA) in 2007; * Nijmegen (The Netherlands) in 2008; * Komarno (Slovakia) in 2009; * Oklahoma (USA) in 2010; * Madrid (Spain) in 2011; * St. Andrews (UK) in 2012; * Provo (Utah, USA) in 2013; * and in Soesterberg (The Netherlands) in 2014. For further general information about TFP please see the TFP homepage. (http://www.tifp.org/). == INVITED SPEAKERS == TFP is pleased to announce talks by the following two invited speakers: * Laurence Rideau is a researcher at INRIA and is interested in the semantics of programming languages , the formal methods, and the verification tools for programs and mathematical proofs. She participated in the beginnings of the Compcert project (certified compiler), and is part of the Component Mathematical team in the MSR-INRIA joint laboratory, who performed the formalization of the Feit-Thompson theorem successfully. Thirty years ago, computers barged in mathematics with the famous proof of the Four Color Theorem. Initially limited to simple calculation, their role is now expanding to the reasoning whose complexity is beyond the capabilities of most humans, as the proof of the classification of finite simple groups. We present our large collaborative adventure around the formalization of the Feit-Thompson theorem (http://en.wikipedia.org/wiki/Feit%E2%80%93Thompson_theorem) that is a first step to the classification of finite groups and that uses a palette of methods and techniques that range from formal logic to software (and mathematics) engineering. * Sam Aaron (?) == SCOPE == The symposium recognizes that new trends may arise through various routes. As part of the Symposium's focus on trends we therefore identify the following five article categories. High-quality articles are solicited in any of these categories: Research Articles: leading-edge, previously unpublished research work Position Articles: on what new trends should or should not be Project Articles: descriptions of recently started new projects Evaluation Articles: what lessons can be drawn from a finished project Overview Articles: summarizing work with respect to a trendy subject Articles must be original and not simultaneously submitted for publication to any other forum. They may consider any aspect of functional programming: theoretical, implementation-oriented, or experience-oriented. Applications of functional programming techniques to other languages are also within the scope of the symposium. Topics suitable for the symposium include: Functional programming and multicore/manycore computing Functional programming in the cloud High performance functional computing Extra-functional (behavioural) properties of functional programs Dependently typed functional programming Validation and verification of functional programs Debugging and profiling for functional languages Functional programming in different application areas: security, mobility, telecommunications applications, embedded systems, global computing, grids, etc. Interoperability with imperative programming languages Novel memory management techniques Program analysis and transformation techniques Empirical performance studies Abstract/virtual machines and compilers for functional languages (Embedded) domain specific languages New implementation strategies Any new emerging trend in the functional programming area If you are in doubt on whether your article is within the scope of TFP, please contact the TFP 2015 program chair, Manuel Serrano. == BEST PAPER AWARDS == To reward excellent contributions, TFP awards a prize for the best paper accepted for the formal proceedings. TFP traditionally pays special attention to research students, acknowledging that students are almost by definition part of new subject trends. A student paper is one for which the authors state that the paper is mainly the work of students, the students are listed as first authors, and a student would present the paper. A prize for the best student paper is awarded each year. In both cases, it is the PC of TFP that awards the prize. In case the best paper happens to be a student paper, that paper will then receive both prizes. == SPONSORS == TFP is financially supported by ?????????????????? == PAPER SUBMISSIONS == Acceptance of articles for presentation at the symposium is based on a lightweight peer review process of extended abstracts (4 to 10 pages in length) or full papers (20 pages). The submission must clearly indicate which category it belongs to: research, position, project, evaluation, or overview paper. It should also indicate which authors are research students, and whether the main author(s) are students. A draft paper for which ALL authors are students will receive additional feedback by one of the PC members shortly after the symposium has taken place. We use EasyChair for the refereeing process. Papers must be submitted at: https://easychair.org/conferences/?conf=tfp2015 Papers must be written in English, and written using the LNCS style. For more information about formatting please consult the Springer LNCS web site: http://www.springer.com/computer/lncs?SGWID=0-164-6-793341-0 == IMPORTANT DATES == Submission of draft papers: March 17, 2015 Notification: March 24, 2015 Registration: April 7, 2015 TFP Symposium: June 3-5, 2015 Student papers feedback: June 9, 2015 Submission for formal review: July 1, 2015 Notification of acceptance: September 8, 2015 Camera ready paper: October 8, 2015 == PROGRAM COMMITTEE == Janis Voigtl?nder University of Bonn, DE Scott Owens University of Kent, UK Neil Sculthorpe Swansea University, UK Colin Runciman University of York, UK Manuel Serrano Inria (PC chair), FR Rinus Plasmeijer University of Nijmegen, NL Tomas Petricek University of Cambridge, UK Marco T. Morazan Seton Hall University, USA Wolfgang De Meuter Vrije Universiteit Brussel, BE Michel Mauny Ensta ParisTech, FR Sam Lindley The University of Edinburgh, UK Daan Leijen Microsoft, USA Jurriaan Hage Utrecht University, NL Andy Gill University of Kansas, USA Thomas Gazagnaire University of Cambrige, UK Lars-Ake Fredlund Universidad Polit?cnica de Madrid, ES Jean-Christophe Filliatre Universit? Paris Sud Orsay, FR Marc Feeley Universit? de Montr?al, CA Olaf Chitil University of Kent, UK Edwin Brady University of St Andrews, UK From ex8k.hibino at gmail.com Fri Dec 19 16:50:16 2014 From: ex8k.hibino at gmail.com (Kei Hibino) Date: Sat, 20 Dec 2014 01:50:16 +0900 (JST) Subject: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL In-Reply-To: <20141219124436.GA20224@weber> References: <20141219.123901.2041677716305014953.ex8k.hibino@gmail.com> <20141219124436.GA20224@weber> Message-ID: <20141220.015016.1996398754200322441.ex8k.hibino@gmail.com> > On Fri, Dec 19, 2014 at 12:39:01PM +0900, Kei Hibino wrote: >> From: Manuel G?mez >> Subject: Re: [Haskell-cafe] [ANN] relational-record - relational-algebraic query building DSL >> Date: Sun, 14 Dec 2014 12:22:25 -0430 >> >> > On Sun, Dec 14, 2014 at 12:04 PM, Kei Hibino wrote: >> >> I am happy to announce relational-record library and its project page. >> >> >> >> relational-record is domain specific language for type-safe SQL query building, >> >> and database access API with compile time schema generators. >> > >> > Congratulations on the release! It?s great to see more and more >> > interesting abstractions for relational databases in the Haskell >> > ecosystem. >> > >> > It looks like this project shares many goals with Tom Ellis? excellent >> > and recently released[1] Opaleye library. How would you say your >> > approach compares with Opaleye?s? >> > >> > [1]: >> >> Relational Record and Opaleye resembles in approach of building >> not aggregated SQL query. >> >> Opaleye's method using arrow notation is very cool. > > Opaleye uses arrows only because it is hard to implement a sensible > semantics otherwise. See, for example, this bug report on HaskellDB which > used a monad rather than an arrow > > https://github.com/m4dc4p/haskelldb/issues/22 > > Tom In my -- Relational Record -- implementation, this issue does not exist like exmaple code below. Both not-finalized monad case (continuing table form building, justAgeOfFamilies0) and finzlined monad (reuse defined table form, justAgeOfFamilies1) are no problem. Key idea is separating out group-by accumulating state and aggregated key result. Operator 'groupBy' accumulates aggregate key into monad stack, and returns aggregated context-typed projection. In aggregated relation, query result type and order-by specified key type are checked to allow only aggregated context-typed projection. > {-# LANGUAGE TemplateHaskell, MultiParamTypeClasses, FlexibleInstances #-} > > import Data.Int > > import Database.Relational.Query > import Database.Relational.Query.TH > > > $(defineTableDefault defaultConfig > "PUBLIC" "my_table" > [ ("person", [t| String |]) > , ("family", [t| String |]) > , ("age" , [t| Int32 |]) > ] > [] [0] (Just 0)) > > > agesOfFamiliesQ :: QueryAggregate (Projection Aggregated (String, Maybe Int32)) > agesOfFamiliesQ = do > my <- query myTable > gFam <- groupBy $ my ! family' > return $ gFam >< sum' (my ! age') > > justAgeOfFamilies0 :: Relation () (Maybe Int32) > justAgeOfFamilies0 = aggregateRelation $ do > pair <- agesOfFamiliesQ > return $ pair ! snd' > > -- *Main> justAgeOfFamilies0 > -- SELECT ALL SUM (T0.age) AS f0 FROM PUBLIC.my_table T0 GROUP BY T0.family > > agesOfFamilies :: Relation () (String, Maybe Int32) > agesOfFamilies = aggregateRelation agesOfFamiliesQ > > justAgeOfFamilies1 :: Relation () (Maybe Int32) > justAgeOfFamilies1 = relation $ do > pair <- query agesOfFamilies > return $ pair ! snd' > > -- *Main> justAgeOfFamilies1 > -- SELECT ALL T1.f1 AS f0 > -- FROM (SELECT ALL T0.family AS f0, SUM (T0.age) AS f1 > -- FROM PUBLIC.my_table T0 GROUP BY T0.family) T1 > > main :: IO () > main = do > putStrLn "0" > print justAgeOfFamilies0 > putStrLn "1" > print justAgeOfFamilies1 -- Kei Hibino ex8k.hibino at gmail.com From ahammel87 at gmail.com Fri Dec 19 17:21:39 2014 From: ahammel87 at gmail.com (Alex Hammel) Date: Fri, 19 Dec 2014 09:21:39 -0800 Subject: [Haskell-cafe] Could someone help me to understand funB? In-Reply-To: References: Message-ID: I suspect that somebody has been abusing pointfree . On Thu, Dec 18, 2014 at 8:35 PM, Magicloud Magiclouds < magicloud.magiclouds at gmail.com> wrote: > > Thank you. This will take some time for me to read. > > On Fri, Dec 19, 2014 at 12:32 PM, Lyndon Maydwell > wrote: >> >> funB = flip takeWhile primes . ( . join (*)) . flip (<=) >> >> funB x = flip takeWhile primes ((( . join (*)) . flip (<=)) x) >> >> funB x = takeWhile ((( . join (*)) . flip (<=)) x) primes >> >> funB x = takeWhile (foo x) primes >> >> >> foo x = (( . join (*)) . flip (<=)) x >> >> foo x = (( . join (*)) (flip (<=) x) >> >> foo x = flip (<=) x . join (*) >> >> foo x = (x <=) . join (*) >> >> >> -- join :: Monad m => m (m a) -> m a >> -- join (*) == (**2) >> >> foo x = (x <=) . (** 2) >> >> foo x y = x <= (y ** 2) >> >> isLessThanTheSquareOf = foo >> >> funB x = takeWhile (x `isLessThanTheSquareOf`) primes >> >> >> Helpful? >> >> >> On Fri, Dec 19, 2014 at 2:52 PM, Magicloud Magiclouds < >> magicloud.magiclouds at gmail.com> wrote: >> >>> Hi, >>> >>> Following code is to get a list of primes. Now it is hard for me to >>> understand funB. I mean I can see what it does. But I cannot see the >>> detailed process by every language part. >>> >>> import Control.Monad >>> >>> isPrime :: Integer -> Bool >>> isPrime i = ap funA funB i >>> >>> funA :: Integer -> [Integer] -> Bool >>> funA x xs = all (\x' -> (mod x x') /= 0) xs >>> >>> funB :: Integer -> [Integer] >>> funB = flip takeWhile primes . ( . join (*)) . flip (<=) >>> >>> primes :: [Integer] >>> primes = 2 : filter isPrime [3, 5 ..] >>> >>> main :: IO () >>> main = print $ take 10 primes >>> >>> -- >>> ??????? >>> ??????? >>> >>> And for G+, please use magiclouds#gmail.com. >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> > > -- > ??????? > ??????? > > And for G+, please use magiclouds#gmail.com. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dct25-561bs at mythic-beasts.com Fri Dec 19 18:32:46 2014 From: dct25-561bs at mythic-beasts.com (David Turner) Date: Fri, 19 Dec 2014 18:32:46 +0000 Subject: [Haskell-cafe] HPC and Template Haskell (GHC 7.8.3, Yesod) Message-ID: Hi, I'm having trouble making a HPC build of a Yesod application. It fails with: /usr/bin/ld: dist/build/StreamReading/Config.dyn_o: relocation R_X86_64_PC32 against undefined symbol `_hpc_tickboxes_tracszmenterprisezm0zi0zi0_Settings_hpc' can not be used when making a shared object; recompile with -fPIC I've narrowed it down to a call to ghc and posted the output in all its gory detail at http://lpaste.net/116872 if that's any help. Of note is that dist/build/Settings.dyn_o is unexpectedly missing from the list of parameters to the last call to gcc, and the missing symbol is defined in the same. There are, in fact, quite a number of missing .dyn_o files in that list. Slightly weirdly, when I run the same command line again, it seems to work. At least, there are no errors reported and the exit code is 0. Any ideas? Cheers, David From alex.solla at gmail.com Fri Dec 19 18:44:44 2014 From: alex.solla at gmail.com (Alexander Solla) Date: Fri, 19 Dec 2014 10:44:44 -0800 Subject: [Haskell-cafe] Hackage 2 archive.tar equivalent Message-ID: On the old hackage site (running Hackage 1.*), we used to be able to download a file called archive.tar, which contained the latest version of all of the Haskell packages. Is there any way to do this with Hackage 2? I understand that my case is definitely a corner case -- I don't have a regular net connection, so I'd really like to be able to download a snapshot of Hackage at regular, convenient intervals, and serve them up at home. -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Fri Dec 19 18:53:28 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Fri, 19 Dec 2014 13:53:28 -0500 Subject: [Haskell-cafe] HPC and Template Haskell (GHC 7.8.3, Yesod) In-Reply-To: References: Message-ID: i think the fix for this, or a related problem is merged into cabal/cabal-install head, and will be in 1.22 does your problem go away if you dont enable profiled builds? (is so, its likely the same problem) On Fri, Dec 19, 2014 at 1:32 PM, David Turner wrote: > Hi, > > I'm having trouble making a HPC build of a Yesod application. It fails > with: > > /usr/bin/ld: dist/build/StreamReading/Config.dyn_o: relocation > R_X86_64_PC32 against undefined symbol > `_hpc_tickboxes_tracszmenterprisezm0zi0zi0_Settings_hpc' can not be > used when making a shared object; recompile with -fPIC > > I've narrowed it down to a call to ghc and posted the output in all > its gory detail at http://lpaste.net/116872 if that's any help. > > Of note is that dist/build/Settings.dyn_o is unexpectedly missing from > the list of parameters to the last call to gcc, and the missing symbol > is defined in the same. There are, in fact, quite a number of missing > .dyn_o files in that list. > > Slightly weirdly, when I run the same command line again, it seems to > work. At least, there are no errors reported and the exit code is 0. > > Any ideas? > > Cheers, > > David > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Fri Dec 19 18:53:58 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Fri, 19 Dec 2014 13:53:58 -0500 Subject: [Haskell-cafe] Hackage 2 archive.tar equivalent In-Reply-To: References: Message-ID: On Fri, Dec 19, 2014 at 1:44 PM, Alexander Solla wrote: > > On the old hackage site (running Hackage 1.*), we used to be able to > download a file called archive.tar, which contained the latest version of > all of the Haskell packages. Is there any way to do this with Hackage 2? > I don't think there is a single convenient tarball. There are several package on hackage (e.g. hackage-server) which can mirror hackage locally, though. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From dct25-561bs at mythic-beasts.com Fri Dec 19 20:03:31 2014 From: dct25-561bs at mythic-beasts.com (David Turner) Date: Fri, 19 Dec 2014 20:03:31 +0000 Subject: [Haskell-cafe] HPC and Template Haskell (GHC 7.8.3, Yesod) In-Reply-To: References: Message-ID: [Failed to copy haskell-cafe in to my first response:] I thought I had disabled profiling there, although it was enabled when I was using cabal which wrote the original command line so that might explain it. I will try a more recent cabal-install this evening. Thanks for the speedy response! [Time passes - second response:] I have tried cabal-install build from the latest revision (4aabb4f4b1) with the same result. From a clean checkout of my source: $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal configure --disable-tests --enable-coverage --disable-profiling $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal build -v Similar outcome. On 19 December 2014 at 18:53, Carter Schonwald wrote: > i think the fix for this, or a related problem is merged into > cabal/cabal-install head, and will be in 1.22 > > does your problem go away if you dont enable profiled builds? (is so, its > likely the same problem) > > On Fri, Dec 19, 2014 at 1:32 PM, David Turner > wrote: >> >> Hi, >> >> I'm having trouble making a HPC build of a Yesod application. It fails >> with: >> >> /usr/bin/ld: dist/build/StreamReading/Config.dyn_o: relocation >> R_X86_64_PC32 against undefined symbol >> `_hpc_tickboxes_tracszmenterprisezm0zi0zi0_Settings_hpc' can not be >> used when making a shared object; recompile with -fPIC >> >> I've narrowed it down to a call to ghc and posted the output in all >> its gory detail at http://lpaste.net/116872 if that's any help. >> >> Of note is that dist/build/Settings.dyn_o is unexpectedly missing from >> the list of parameters to the last call to gcc, and the missing symbol >> is defined in the same. There are, in fact, quite a number of missing >> .dyn_o files in that list. >> >> Slightly weirdly, when I run the same command line again, it seems to >> work. At least, there are no errors reported and the exit code is 0. >> >> Any ideas? >> >> Cheers, >> >> David >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > From dct25-561bs at mythic-beasts.com Fri Dec 19 20:28:20 2014 From: dct25-561bs at mythic-beasts.com (David Turner) Date: Fri, 19 Dec 2014 20:28:20 +0000 Subject: [Haskell-cafe] HPC and Template Haskell (GHC 7.8.3, Yesod) In-Reply-To: References: Message-ID: Ok, I can reproduce this with a bare Yesod scaffold (using the latest cabal-install) - see below. If I run cabal build a couple more times, it completes successfully, which is mighty strange! [linuxadmin at vm01 20:19:43 ~ ] $ yesod init Welcome to the Yesod scaffolder. I'm going to be creating a skeleton Yesod project for you. What do you want to call your project? We'll use this for the cabal name. Project name: linker-test Yesod uses Persistent for its (you guessed it) persistence layer. This tool will build in either SQLite or PostgreSQL or MongoDB support for you. We recommend starting with SQLite: it has no dependencies. s = sqlite p = postgresql pf = postgresql + Fay (experimental) mongo = mongodb mysql = MySQL simple = no database, no auth url = Let me specify URL containing a site (advanced) So, what'll it be? simple That's it! I'm creating your files now... --------------------------------------- ___ {-) |\ [m,].-"-. / [][__][__] \(/\__/\)/ [__][__][__][__]~~~~ | | [][__][__][__][__][] / | [__][__][__][__][__]| /| | [][__][__][__][__][]| || | ~~~~ ejm [__][__][__][__][__]__,__, \__/ --------------------------------------- The foundation for your web application has been built. There are a lot of resources to help you use Yesod. Start with the book: http://www.yesodweb.com/book Take part in the community: http://yesodweb.com/page/community It's highly recommended to follow the quick start guide for installing Yesod: http://www.yesodweb.com/page/quickstart If your system is already configured correctly, please run: cd linker-test && cabal install -j --enable-tests --max-backjumps=-1 --reorder-goals && yesod devel [linuxadmin at vm01 20:20:07 ~ ] $ cd linker-test [linuxadmin at vm01 20:20:11 ~/linker-test ] $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal configure --disable-tests --enable-coverage --disable-profiling Resolving dependencies... Configuring linker-test-0.0.0... [linuxadmin at vm01 20:20:25 ~/linker-test ] $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal build Building linker-test-0.0.0... Preprocessing library linker-test-0.0.0... [1 of 7] Compiling Settings.Development ( Settings/Development.hs, dist/build/Settings/Development.o ) [2 of 7] Compiling Settings ( Settings.hs, dist/build/Settings.o ) Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package array-0.5.0.0 ... linking ... done. Loading package stm-2.4.3 ... linking ... done. Loading package async-2.0.1.6 ... linking ... done. Loading package deepseq-1.3.0.2 ... linking ... done. Loading package bytestring-0.10.4.0 ... linking ... done. Loading package containers-0.5.5.1 ... linking ... done. Loading package text-1.1.1.3 ... linking ... done. Loading package hashable-1.2.2.0 ... linking ... done. Loading package scientific-0.3.3.2 ... linking ... done. Loading package attoparsec-0.12.1.2 ... linking ... done. Loading package base64-bytestring-1.0.0.1 ... linking ... done. Loading package blaze-builder-0.3.3.4 ... linking ... done. Loading package byteable-0.1.1 ... linking ... done. Loading package transformers-0.3.0.0 ... linking ... done. Loading package mtl-2.1.3.1 ... linking ... done. Loading package exceptions-0.6.1 ... linking ... done. Loading package base-unicode-symbols-0.2.2.4 ... linking ... done. Loading package transformers-base-0.4.3 ... linking ... done. Loading package monad-control-0.3.3.0 ... linking ... done. Loading package lifted-base-0.2.2.1 ... linking ... done. Loading package mmorph-1.0.4 ... linking ... done. Loading package resourcet-1.1.3 ... linking ... done. Loading package nats-0.2 ... linking ... done. Loading package unordered-containers-0.2.5.1 ... linking ... done. Loading package semigroups-0.15.4 ... linking ... done. Loading package void-0.6.1 ... linking ... done. Loading package conduit-1.2.3 ... linking ... done. Loading package filepath-1.3.0.2 ... linking ... done. Loading package old-locale-1.0.0.6 ... linking ... done. Loading package time-1.4.2 ... linking ... done. Loading package unix-2.7.0.1 ... linking ... done. Loading package directory-1.2.1.0 ... linking ... done. Loading package parsec-3.1.7 ... linking ... done. Loading package network-2.5.0.0 ... linking ... done. Loading package primitive-0.5.4.0 ... linking ... done. Loading package process-1.2.0.0 ... linking ... done. Loading package random-1.0.1.1 ... linking ... done. Loading package zlib-0.5.4.2 ... linking ... done. Loading package streaming-commons-0.1.6 ... linking ... done. Loading package conduit-extra-1.1.4.2 ... linking ... done. Loading package cryptohash-0.11.6 ... linking ... done. Loading package cryptohash-conduit-0.1.1 ... linking ... done. Loading package css-text-0.1.2.1 ... linking ... done. Loading package data-default-class-0.0.1 ... linking ... done. Loading package data-default-instances-base-0.0.1 ... linking ... done. Loading package data-default-instances-containers-0.0.1 ... linking ... done. Loading package dlist-0.7.1 ... linking ... done. Loading package data-default-instances-dlist-0.0.1 ... linking ... done. Loading package data-default-instances-old-locale-0.0.1 ... linking ... done. Loading package data-default-0.5.3 ... linking ... done. Loading package pretty-1.1.1.1 ... linking ... done. Loading package template-haskell ... linking ... done. Loading package file-embed-0.0.7 ... linking ... done. Loading package utf8-string-0.3.8 ... linking ... done. Loading package language-javascript-0.5.13 ... linking ... done. Loading package hjsmin-0.1.4.7 ... linking ... done. Loading package case-insensitive-1.2.0.1 ... linking ... done. Loading package http-types-0.8.5 ... linking ... done. Loading package mime-types-0.1.0.4 ... linking ... done. Loading package old-time-1.1.0.2 ... linking ... done. Loading package system-filepath-0.4.12 ... linking ... done. Loading package system-fileio-0.3.15 ... linking ... done. Loading package unix-compat-0.4.1.3 ... linking ... done. Loading package vault-0.3.0.3 ... linking ... done. Loading package wai-3.0.2 ... linking ... done. Loading package blaze-markup-0.6.1.1 ... linking ... done. Loading package blaze-html-0.7.0.3 ... linking ... done. Loading package http-date-0.0.4 ... linking ... done. Loading package ansi-terminal-0.6.2.1 ... linking ... done. Loading package ansi-wl-pprint-0.6.7.1 ... linking ... done. Loading package transformers-compat-0.3.3.3 ... linking ... done. Loading package optparse-applicative-0.11.0.1 ... linking ... done. Loading package auto-update-0.1.2 ... linking ... done. Loading package fast-logger-2.2.3 ... linking ... done. Loading package stringsearch-0.3.6.5 ... linking ... done. Loading package byteorder-1.0.4 ... linking ... done. Loading package easy-file-0.2.0 ... linking ... done. Loading package binary-0.7.1.0 ... linking ... done. Loading package unix-time-0.3.4 ... linking ... done. Loading package wai-logger-2.2.3 ... linking ... done. Loading package word8-0.1.1 ... linking ... done. Loading package wai-extra-3.0.2.1 ... linking ... done. Loading package simple-sendfile-0.2.18 ... linking ... done. Loading package warp-3.0.2.3 ... linking ... done. Loading package wai-app-static-3.0.0.3 ... linking ... done. Loading package syb-0.4.2 ... linking ... done. Loading package vector-0.10.12.1 ... linking ... done. Loading package aeson-0.8.0.2 ... linking ... done. Loading package cereal-0.4.1.0 ... linking ... done. Loading package securemem-0.1.4 ... linking ... done. Loading package crypto-cipher-types-0.0.9 ... linking ... done. Loading package cipher-aes-0.2.9 ... linking ... done. Loading package crypto-random-0.0.8 ... linking ... done. Loading package cprng-aes-0.6.1 ... linking ... done. Loading package entropy-0.3.4.1 ... linking ... done. Loading package tagged-0.7.3 ... linking ... done. Loading package crypto-api-0.13.2 ... linking ... done. Loading package setenv-0.1.1.1 ... linking ... done. Loading package skein-1.0.9.1 ... linking ... done. Loading package clientsession-0.9.1.1 ... linking ... done. Loading package cookie-0.4.1.4 ... linking ... done. Loading package monad-loops-0.4.2.1 ... linking ... done. Loading package stm-chans-3.0.0.2 ... linking ... done. Loading package monad-logger-0.3.9 ... linking ... done. Loading package mwc-random-0.13.2.2 ... linking ... done. Loading package path-pieces-0.1.4 ... linking ... done. Loading package safe-0.3.8 ... linking ... done. Loading package shakespeare-2.0.2.1 ... linking ... done. Loading package yesod-core-1.4.4.5 ... linking ... done. Loading package yesod-static-1.4.0.3 ... linking ... done. Loading package yaml-0.8.10 ... linking ... done. Loading package publicsuffixlist-0.1 ... linking ... done. Loading package http-client-0.4.5 ... linking ... done. Loading package socks-0.5.4 ... linking ... done. Loading package hourglass-0.2.6 ... linking ... done. Loading package asn1-types-0.3.0 ... linking ... done. Loading package asn1-encoding-0.9.0 ... linking ... done. Loading package cipher-des-0.0.6 ... linking ... done. Loading package cipher-rc4-0.1.4 ... linking ... done. Loading package crypto-numbers-0.2.3 ... linking ... done. Loading package crypto-pubkey-types-0.4.2.3 ... linking ... done. Loading package crypto-pubkey-0.2.4 ... linking ... done. Loading package asn1-parse-0.9.0 ... linking ... done. Loading package pem-0.2.2 ... linking ... done. Loading package x509-1.5.0.1 ... linking ... done. Loading package x509-store-1.5.0 ... linking ... done. Loading package x509-validation-1.5.1 ... linking ... done. Loading package tls-1.2.13 ... linking ... done. Loading package x509-system-1.5.0 ... linking ... done. Loading package connection-0.2.3 ... linking ... done. Loading package http-client-tls-0.2.2 ... linking ... done. Loading package http-conduit-2.1.5 ... linking ... done. Loading package xml-types-0.3.4 ... linking ... done. Loading package xml-conduit-1.2.3 ... linking ... done. Loading package tagstream-conduit-0.5.5.3 ... linking ... done. Loading package authenticate-1.3.2.10 ... linking ... done. Loading package base16-bytestring-0.1.1.6 ... linking ... done. Loading package email-validate-2.0.1 ... linking ... done. Loading package mime-mail-0.4.6 ... linking ... done. Loading package resource-pool-0.2.3.1 ... linking ... done. Loading package silently-1.2.4.1 ... linking ... done. Loading package persistent-2.1.1 ... linking ... done. Loading package persistent-template-2.1 ... linking ... done. Loading package tagsoup-0.13.3 ... linking ... done. Loading package xss-sanitize-0.3.5.4 ... linking ... done. Loading package yesod-persistent-1.4.0.1 ... linking ... done. Loading package yesod-form-1.4.1.1 ... linking ... done. Loading package yesod-auth-1.4.1 ... linking ... done. Loading package yesod-1.4.1 ... linking ... done. [3 of 7] Compiling Settings.StaticFiles ( Settings/StaticFiles.hs, dist/build/Settings/StaticFiles.o ) [4 of 7] Compiling Foundation ( Foundation.hs, dist/build/Foundation.o ) [5 of 7] Compiling Import ( Import.hs, dist/build/Import.o ) [6 of 7] Compiling Handler.Home ( Handler/Home.hs, dist/build/Handler/Home.o ) [7 of 7] Compiling Application ( Application.hs, dist/build/Application.o ) /usr/bin/ld: dist/build/Foundation.dyn_o: relocation R_X86_64_PC32 against undefined symbol `_hpc_tickboxes_linkerzmtestzm0zi0zi0_Settings_hpc' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status : ghc: phase `Linker' failed (exitcode = 1) [linuxadmin at vm01 20:20:38 ~/linker-test ] $ On 19 December 2014 at 20:21, David Turner wrote: > Ok, I can reproduce this with a bare Yesod scaffold: > > [linuxadmin at vm01 20:19:43 ~ ] > $ yesod init > Welcome to the Yesod scaffolder. > I'm going to be creating a skeleton Yesod project for you. > > What do you want to call your project? We'll use this for the cabal name. > > Project name: linker-test > Yesod uses Persistent for its (you guessed it) persistence layer. > This tool will build in either SQLite or PostgreSQL or MongoDB support for you. > We recommend starting with SQLite: it has no dependencies. > > s = sqlite > p = postgresql > pf = postgresql + Fay (experimental) > mongo = mongodb > mysql = MySQL > simple = no database, no auth > url = Let me specify URL containing a site (advanced) > > So, what'll it be? simple > That's it! I'm creating your files now... > > --------------------------------------- > > ___ > {-) |\ > [m,].-"-. / > [][__][__] \(/\__/\)/ > [__][__][__][__]~~~~ | | > [][__][__][__][__][] / | > [__][__][__][__][__]| /| | > [][__][__][__][__][]| || | ~~~~ > ejm [__][__][__][__][__]__,__, \__/ > > > --------------------------------------- > > The foundation for your web application has been built. > > > There are a lot of resources to help you use Yesod. > Start with the book: http://www.yesodweb.com/book > Take part in the community: http://yesodweb.com/page/community > > > It's highly recommended to follow the quick start guide for > installing Yesod: http://www.yesodweb.com/page/quickstart > > If your system is already configured correctly, please run: > > cd linker-test && cabal install -j --enable-tests > --max-backjumps=-1 --reorder-goals && yesod devel > [linuxadmin at vm01 20:20:07 ~ ] > $ cd linker-test > [linuxadmin at vm01 20:20:11 ~/linker-test ] > $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal configure > --disable-tests --enable-coverage --disable-profiling > Resolving dependencies... > Configuring linker-test-0.0.0... > [linuxadmin at vm01 20:20:25 ~/linker-test ] > $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal build > Building linker-test-0.0.0... > Preprocessing library linker-test-0.0.0... > [1 of 7] Compiling Settings.Development ( Settings/Development.hs, > dist/build/Settings/Development.o ) > [2 of 7] Compiling Settings ( Settings.hs, dist/build/Settings.o ) > Loading package ghc-prim ... linking ... done. > Loading package integer-gmp ... linking ... done. > Loading package base ... linking ... done. > Loading package array-0.5.0.0 ... linking ... done. > Loading package stm-2.4.3 ... linking ... done. > Loading package async-2.0.1.6 ... linking ... done. > Loading package deepseq-1.3.0.2 ... linking ... done. > Loading package bytestring-0.10.4.0 ... linking ... done. > Loading package containers-0.5.5.1 ... linking ... done. > Loading package text-1.1.1.3 ... linking ... done. > Loading package hashable-1.2.2.0 ... linking ... done. > Loading package scientific-0.3.3.2 ... linking ... done. > Loading package attoparsec-0.12.1.2 ... linking ... done. > Loading package base64-bytestring-1.0.0.1 ... linking ... done. > Loading package blaze-builder-0.3.3.4 ... linking ... done. > Loading package byteable-0.1.1 ... linking ... done. > Loading package transformers-0.3.0.0 ... linking ... done. > Loading package mtl-2.1.3.1 ... linking ... done. > Loading package exceptions-0.6.1 ... linking ... done. > Loading package base-unicode-symbols-0.2.2.4 ... linking ... done. > Loading package transformers-base-0.4.3 ... linking ... done. > Loading package monad-control-0.3.3.0 ... linking ... done. > Loading package lifted-base-0.2.2.1 ... linking ... done. > Loading package mmorph-1.0.4 ... linking ... done. > Loading package resourcet-1.1.3 ... linking ... done. > Loading package nats-0.2 ... linking ... done. > Loading package unordered-containers-0.2.5.1 ... linking ... done. > Loading package semigroups-0.15.4 ... linking ... done. > Loading package void-0.6.1 ... linking ... done. > Loading package conduit-1.2.3 ... linking ... done. > Loading package filepath-1.3.0.2 ... linking ... done. > Loading package old-locale-1.0.0.6 ... linking ... done. > Loading package time-1.4.2 ... linking ... done. > Loading package unix-2.7.0.1 ... linking ... done. > Loading package directory-1.2.1.0 ... linking ... done. > Loading package parsec-3.1.7 ... linking ... done. > Loading package network-2.5.0.0 ... linking ... done. > Loading package primitive-0.5.4.0 ... linking ... done. > Loading package process-1.2.0.0 ... linking ... done. > Loading package random-1.0.1.1 ... linking ... done. > Loading package zlib-0.5.4.2 ... linking ... done. > Loading package streaming-commons-0.1.6 ... linking ... done. > Loading package conduit-extra-1.1.4.2 ... linking ... done. > Loading package cryptohash-0.11.6 ... linking ... done. > Loading package cryptohash-conduit-0.1.1 ... linking ... done. > Loading package css-text-0.1.2.1 ... linking ... done. > Loading package data-default-class-0.0.1 ... linking ... done. > Loading package data-default-instances-base-0.0.1 ... linking ... done. > Loading package data-default-instances-containers-0.0.1 ... linking ... done. > Loading package dlist-0.7.1 ... linking ... done. > Loading package data-default-instances-dlist-0.0.1 ... linking ... done. > Loading package data-default-instances-old-locale-0.0.1 ... linking ... done. > Loading package data-default-0.5.3 ... linking ... done. > Loading package pretty-1.1.1.1 ... linking ... done. > Loading package template-haskell ... linking ... done. > Loading package file-embed-0.0.7 ... linking ... done. > Loading package utf8-string-0.3.8 ... linking ... done. > Loading package language-javascript-0.5.13 ... linking ... done. > Loading package hjsmin-0.1.4.7 ... linking ... done. > Loading package case-insensitive-1.2.0.1 ... linking ... done. > Loading package http-types-0.8.5 ... linking ... done. > Loading package mime-types-0.1.0.4 ... linking ... done. > Loading package old-time-1.1.0.2 ... linking ... done. > Loading package system-filepath-0.4.12 ... linking ... done. > Loading package system-fileio-0.3.15 ... linking ... done. > Loading package unix-compat-0.4.1.3 ... linking ... done. > Loading package vault-0.3.0.3 ... linking ... done. > Loading package wai-3.0.2 ... linking ... done. > Loading package blaze-markup-0.6.1.1 ... linking ... done. > Loading package blaze-html-0.7.0.3 ... linking ... done. > Loading package http-date-0.0.4 ... linking ... done. > Loading package ansi-terminal-0.6.2.1 ... linking ... done. > Loading package ansi-wl-pprint-0.6.7.1 ... linking ... done. > Loading package transformers-compat-0.3.3.3 ... linking ... done. > Loading package optparse-applicative-0.11.0.1 ... linking ... done. > Loading package auto-update-0.1.2 ... linking ... done. > Loading package fast-logger-2.2.3 ... linking ... done. > Loading package stringsearch-0.3.6.5 ... linking ... done. > Loading package byteorder-1.0.4 ... linking ... done. > Loading package easy-file-0.2.0 ... linking ... done. > Loading package binary-0.7.1.0 ... linking ... done. > Loading package unix-time-0.3.4 ... linking ... done. > Loading package wai-logger-2.2.3 ... linking ... done. > Loading package word8-0.1.1 ... linking ... done. > Loading package wai-extra-3.0.2.1 ... linking ... done. > Loading package simple-sendfile-0.2.18 ... linking ... done. > Loading package warp-3.0.2.3 ... linking ... done. > Loading package wai-app-static-3.0.0.3 ... linking ... done. > Loading package syb-0.4.2 ... linking ... done. > Loading package vector-0.10.12.1 ... linking ... done. > Loading package aeson-0.8.0.2 ... linking ... done. > Loading package cereal-0.4.1.0 ... linking ... done. > Loading package securemem-0.1.4 ... linking ... done. > Loading package crypto-cipher-types-0.0.9 ... linking ... done. > Loading package cipher-aes-0.2.9 ... linking ... done. > Loading package crypto-random-0.0.8 ... linking ... done. > Loading package cprng-aes-0.6.1 ... linking ... done. > Loading package entropy-0.3.4.1 ... linking ... done. > Loading package tagged-0.7.3 ... linking ... done. > Loading package crypto-api-0.13.2 ... linking ... done. > Loading package setenv-0.1.1.1 ... linking ... done. > Loading package skein-1.0.9.1 ... linking ... done. > Loading package clientsession-0.9.1.1 ... linking ... done. > Loading package cookie-0.4.1.4 ... linking ... done. > Loading package monad-loops-0.4.2.1 ... linking ... done. > Loading package stm-chans-3.0.0.2 ... linking ... done. > Loading package monad-logger-0.3.9 ... linking ... done. > Loading package mwc-random-0.13.2.2 ... linking ... done. > Loading package path-pieces-0.1.4 ... linking ... done. > Loading package safe-0.3.8 ... linking ... done. > Loading package shakespeare-2.0.2.1 ... linking ... done. > Loading package yesod-core-1.4.4.5 ... linking ... done. > Loading package yesod-static-1.4.0.3 ... linking ... done. > Loading package yaml-0.8.10 ... linking ... done. > Loading package publicsuffixlist-0.1 ... linking ... done. > Loading package http-client-0.4.5 ... linking ... done. > Loading package socks-0.5.4 ... linking ... done. > Loading package hourglass-0.2.6 ... linking ... done. > Loading package asn1-types-0.3.0 ... linking ... done. > Loading package asn1-encoding-0.9.0 ... linking ... done. > Loading package cipher-des-0.0.6 ... linking ... done. > Loading package cipher-rc4-0.1.4 ... linking ... done. > Loading package crypto-numbers-0.2.3 ... linking ... done. > Loading package crypto-pubkey-types-0.4.2.3 ... linking ... done. > Loading package crypto-pubkey-0.2.4 ... linking ... done. > Loading package asn1-parse-0.9.0 ... linking ... done. > Loading package pem-0.2.2 ... linking ... done. > Loading package x509-1.5.0.1 ... linking ... done. > Loading package x509-store-1.5.0 ... linking ... done. > Loading package x509-validation-1.5.1 ... linking ... done. > Loading package tls-1.2.13 ... linking ... done. > Loading package x509-system-1.5.0 ... linking ... done. > Loading package connection-0.2.3 ... linking ... done. > Loading package http-client-tls-0.2.2 ... linking ... done. > Loading package http-conduit-2.1.5 ... linking ... done. > Loading package xml-types-0.3.4 ... linking ... done. > Loading package xml-conduit-1.2.3 ... linking ... done. > Loading package tagstream-conduit-0.5.5.3 ... linking ... done. > Loading package authenticate-1.3.2.10 ... linking ... done. > Loading package base16-bytestring-0.1.1.6 ... linking ... done. > Loading package email-validate-2.0.1 ... linking ... done. > Loading package mime-mail-0.4.6 ... linking ... done. > Loading package resource-pool-0.2.3.1 ... linking ... done. > Loading package silently-1.2.4.1 ... linking ... done. > Loading package persistent-2.1.1 ... linking ... done. > Loading package persistent-template-2.1 ... linking ... done. > Loading package tagsoup-0.13.3 ... linking ... done. > Loading package xss-sanitize-0.3.5.4 ... linking ... done. > Loading package yesod-persistent-1.4.0.1 ... linking ... done. > Loading package yesod-form-1.4.1.1 ... linking ... done. > Loading package yesod-auth-1.4.1 ... linking ... done. > Loading package yesod-1.4.1 ... linking ... done. > [3 of 7] Compiling Settings.StaticFiles ( Settings/StaticFiles.hs, > dist/build/Settings/StaticFiles.o ) > [4 of 7] Compiling Foundation ( Foundation.hs, dist/build/Foundation.o ) > [5 of 7] Compiling Import ( Import.hs, dist/build/Import.o ) > [6 of 7] Compiling Handler.Home ( Handler/Home.hs, > dist/build/Handler/Home.o ) > [7 of 7] Compiling Application ( Application.hs, dist/build/Application.o ) > /usr/bin/ld: dist/build/Foundation.dyn_o: relocation R_X86_64_PC32 > against undefined symbol > `_hpc_tickboxes_linkerzmtestzm0zi0zi0_Settings_hpc' can not be used > when making a shared object; recompile with -fPIC > /usr/bin/ld: final link failed: Bad value > collect2: error: ld returned 1 exit status > > : ghc: phase `Linker' failed (exitcode = 1) > [linuxadmin at vm01 20:20:38 ~/linker-test ] > $ > > On 19 December 2014 at 20:03, David Turner > wrote: >> [Failed to copy haskell-cafe in to my first response:] >> >> I thought I had disabled profiling there, although it was enabled when >> I was using cabal which wrote the original command line so that might >> explain it. >> >> I will try a more recent cabal-install this evening. >> >> Thanks for the speedy response! >> >> [Time passes - second response:] >> >> I have tried cabal-install build from the latest revision (4aabb4f4b1) >> with the same result. From a clean checkout of my source: >> >> $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal configure >> --disable-tests --enable-coverage --disable-profiling >> $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal build -v >> >> Similar outcome. >> >> >> >> >> On 19 December 2014 at 18:53, Carter Schonwald >> wrote: >>> i think the fix for this, or a related problem is merged into >>> cabal/cabal-install head, and will be in 1.22 >>> >>> does your problem go away if you dont enable profiled builds? (is so, its >>> likely the same problem) >>> >>> On Fri, Dec 19, 2014 at 1:32 PM, David Turner >>> wrote: >>>> >>>> Hi, >>>> >>>> I'm having trouble making a HPC build of a Yesod application. It fails >>>> with: >>>> >>>> /usr/bin/ld: dist/build/StreamReading/Config.dyn_o: relocation >>>> R_X86_64_PC32 against undefined symbol >>>> `_hpc_tickboxes_tracszmenterprisezm0zi0zi0_Settings_hpc' can not be >>>> used when making a shared object; recompile with -fPIC >>>> >>>> I've narrowed it down to a call to ghc and posted the output in all >>>> its gory detail at http://lpaste.net/116872 if that's any help. >>>> >>>> Of note is that dist/build/Settings.dyn_o is unexpectedly missing from >>>> the list of parameters to the last call to gcc, and the missing symbol >>>> is defined in the same. There are, in fact, quite a number of missing >>>> .dyn_o files in that list. >>>> >>>> Slightly weirdly, when I run the same command line again, it seems to >>>> work. At least, there are no errors reported and the exit code is 0. >>>> >>>> Any ideas? >>>> >>>> Cheers, >>>> >>>> David >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> From david.feuer at gmail.com Fri Dec 19 21:02:46 2014 From: david.feuer at gmail.com (David Feuer) Date: Fri, 19 Dec 2014 16:02:46 -0500 Subject: [Haskell-cafe] <*> for Data.Sequence: mission accomplished Message-ID: All right! It's taken a long time, but I finally managed to write a nice implementation of `<*>` for `Data.Sequence`! It looks nothing like my original concept, but it accomplishes my incremental performance goals while also being a little better than the current implementation when forcing the whole result. Anyone interested can see the code in the `ap` branch of treeowl/containers on GitHub. There are still some ugly special cases for sufficiently small arguments--any ideas for changing that would be most welcome. Many thanks to Joachim Breitner for helping implement an earlier approach, to Ross Paterson for coming up with a solution to a previous formulation of the problem (thus helping me understand that I had asked the wrong question), and to Carter Schonwald for putting up with my stream of consciousness rambling. On Sun, Nov 23, 2014 at 12:07 AM, David Feuer wrote: > OK, sorry for the flood of posts, but I think I've found a way to make that > work. Specifically, I think I can write a three-Seq append that takes the > total size and uses it to be as lazy as possible in the second of the three > Seqs. I'm still working out the details, but I think it will work. It does > the (possibly avoidable) rebuilding, but I *think* it's at least > asymptotically optimal. Of course, if Ross Paterson can find something more > efficient, that'd be even better. > > On Sat, Nov 22, 2014 at 10:10 PM, David Feuer wrote: >> >> OK, so I've thought about this some more. I think the essential *concept* >> I want is close to this, but it won't quite work this way: >> >> fs <*> xs = equalJoin $ fmap (<$> xs) fs >> >> equalJoin :: Int -> Seq (Seq a) -> Seq a >> equalJoin n s >> | length s <= 2*n = simpleJoin s >> | otherwise = simpleJoin pref >< >> equalJoin (2*n) mid >< >> simpleJoin suff >> where (pref, s') = splitAt n s >> (mid, suff) = splitAt (length s - 2*n) s' >> >> simpleJoin :: Seq (Seq a) -> Seq a >> simpleJoin s >> | null s = empty >> | length s == 1 = index s 0 >> | otherwise = simpleJoin front >< simpleJoin back >> where >> (front,back) = splitAt (length s `quot` 2) s >> >> I think the reason this doesn't work is that >< is too strict. I believe >> the only potential way around this is to dig into the FingerTree >> representation and build the thing top-down. I still don't understand how >> (if at all) this can be done. >> >> >> On Sat, Nov 22, 2014 at 12:57 PM, David Feuer >> wrote: >>> >>> The ideal goal, which has taken me forever to identify and which may well >>> be unattainable, is to get O(log(min{i,mn-i})) access to each element of the >>> result, while maintaining O(mn) time to force it entirely. Each of these is >>> possible separately, of course. To get them both, if it's possible, we need >>> to give up on the list-like approach and start splitting Seqs instead of >>> lists. As we descend, we want to pass a single thunk to each element of each >>> Digit to give it just enough to do its thing. Representing the splits >>> efficiently and/or memoizing them could be a bit of a challenge. >>> >>> On Fri, Nov 21, 2014 at 02:00:16PM -0500, David Feuer wrote: >>> > To be precise, I *think* using the fromList approach for <*> makes us >>> > create O >>> > (n) thunks in order to extract the last element of the result. If we >>> > build the >>> > result inward, I *think* we can avoid this, getting the last element of >>> > the >>> > result in O(1) time and space. But my understanding of this data >>> > structure >>> > remains primitive. >>> >>> This modification of the previous should do that. >>> >>> mult :: Seq (a -> b) -> Seq a -> Seq b >>> mult sfs sxs = fromTwoLists (length sfs * length sxs) ys rev_ys >>> where >>> fs = toList sfs >>> rev_fs = toRevList sfs >>> xs = toList sxs >>> rev_xs = toRevList sxs >>> ys = [f x | f <- fs, x <- xs] >>> rev_ys = [f x | f <- rev_fs, x <- rev_xs] >>> >>> -- toRevList xs = toList (reverse xs) >>> toRevList :: Seq a -> [a] >>> toRevList = foldl (flip (:)) [] >>> >>> -- Build a tree lazy in the middle, from a list and its reverse. >>> -- >>> -- fromTwoLists (length xs) xs (reverse xs) = fromList xs >>> -- >>> -- Getting the kth element from either end involves forcing the lists >>> -- to length k. >>> fromTwoLists :: Int -> [a] -> [a] -> Seq a >>> fromTwoLists len_xs xs rev_xs = >>> Seq $ mkTree2 len_xs 1 (map Elem xs) (map Elem rev_xs) >>> >>> -- Construct a fingertree from the first n elements of xs. >>> -- The arguments must satisfy n <= length xs && rev_xs = reverse xs. >>> -- Each element of xs has the same size, provided as an argument. >>> mkTree2 :: Int -> Int -> [a] -> [a] -> FingerTree a >>> mkTree2 n size xs rev_xs >>> | n == 0 = Empty >>> | n == 1 = let [x1] = xs in Single x1 >>> | n < 6 = let >>> nl = n `div` 2 >>> l = Data.List.take nl xs >>> r = Data.List.take (n - nl) rev_xs >>> in Deep totalSize (mkDigit l) Empty (mkRevDigit r) >>> | otherwise = let >>> size' = 3*size >>> n' = (n-4) `div` 3 >>> digits = n - n'*3 >>> nl = digits `div` 2 >>> (l, xs') = Data.List.splitAt nl xs >>> (r, rev_xs') = Data.List.splitAt (digits - nl) rev_xs >>> nodes = mkNodes size' xs' >>> rev_nodes = mkRevNodes size' rev_xs' >>> in Deep totalSize (mkDigit l) (mkTree2 n' size' nodes rev_nodes) >>> (mkRevDigit r) >>> where >>> totalSize = n*size >>> >>> mkDigit :: [a] -> Digit a >>> mkDigit [x1] = One x1 >>> mkDigit [x1, x2] = Two x1 x2 >>> mkDigit [x1, x2, x3] = Three x1 x2 x3 >>> mkDigit [x1, x2, x3, x4] = Four x1 x2 x3 x4 >>> >>> -- length xs <= 4 => mkRevDigit xs = mkDigit (reverse xs) >>> mkRevDigit :: [a] -> Digit a >>> mkRevDigit [x1] = One x1 >>> mkRevDigit [x2, x1] = Two x1 x2 >>> mkRevDigit [x3, x2, x1] = Three x1 x2 x3 >>> mkRevDigit [x4, x3, x2, x1] = Four x1 x2 x3 x4 >>> >>> mkNodes :: Int -> [a] -> [Node a] >>> mkNodes size (x1:x2:x3:xs) = Node3 size x1 x2 x3:mkNodes size xs >>> >>> -- length xs `mod` 3 == 0 => >>> -- mkRevNodes size xs = reverse (mkNodes size (reverse xs)) >>> mkRevNodes :: Int -> [a] -> [Node a] >>> mkRevNodes size (x3:x2:x1:xs) = Node3 size x1 x2 x3:mkRevNodes size xs >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > From felipe.lessa at gmail.com Sat Dec 20 00:01:38 2014 From: felipe.lessa at gmail.com (Felipe Lessa) Date: Fri, 19 Dec 2014 22:01:38 -0200 Subject: [Haskell-cafe] <*> for Data.Sequence: mission accomplished In-Reply-To: References: Message-ID: <5494BC62.1050401@gmail.com> On 19-12-2014 19:02, David Feuer wrote: > All right! It's taken a long time, but I finally managed to write a > nice implementation of `<*>` for `Data.Sequence`! It looks nothing > like my original concept, but it accomplishes my incremental > performance goals while also being a little better than the current > implementation when forcing the whole result. Anyone interested can > see the code in the `ap` branch of treeowl/containers on GitHub. There > are still some ugly special cases for sufficiently small > arguments--any ideas for changing that would be most welcome. Link for the lazy like me: https://github.com/treeowl/containers/compare/ap > Many thanks to Joachim Breitner for helping implement an earlier > approach, to Ross Paterson for coming up with a solution to a previous > formulation of the problem (thus helping me understand that I had > asked the wrong question), and to Carter Schonwald for putting up with > my stream of consciousness rambling. Nice work! I've got some questions/suggestions: - It would be nice to have at least one comment explaining the decisions surrounding the code and how it works. I read it without previous knowledge about how it would accomplish its goal and it was a bit painful. It's pretty clever code! - Why is ap3FT the only of the ap*FT family that cares about length fs < 2? - Why have the ap* family of functions instead of just deconstructing fs and wrapping Seq on apShort? Cheers! -- Felipe. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From mike at proclivis.com Sat Dec 20 00:21:19 2014 From: mike at proclivis.com (Michael Jones) Date: Fri, 19 Dec 2014 17:21:19 -0700 Subject: [Haskell-cafe] Random pattern generation with list comprehensions In-Reply-To: <2bd3631a-4d11-40ec-b3fc-c76eab84bb5d@googlegroups.com> References: <9EA1A2E7-40AE-4890-83E2-B41026B379D4@proclivis.com> <2bd3631a-4d11-40ec-b3fc-c76eab84bb5d@googlegroups.com> Message-ID: <9A362535-B57A-4C32-98DE-D130630E8DDC@proclivis.com> Here is some prototype code, and some comments and questions. getInts and getDoubles use the State Monad approach to generate data. getInts requires putting the generator in the list comprehension. getDouble wraps it in a function. getLetters just directly generates ints and converts to enums. This is in an IO monad because the final code will be in the IO monad. Questions: - Can anyone see any value in the StateMonad in terms of ways to exploit it? - Is there a way to get the number of constructors in Letter rather than code the number directly as (0,2)? - What is the impact of defining the helper functions in let vs. where? Mike type GeneratorState = State StdGen getRandom :: Random a => GeneratorState a getRandom = do generator <- get let (value, newGenerator) = random generator put newGenerator return value data Letter = A | B | C deriving (Eq, Enum, Show) runRandomTest = do let ds = [(i, d, l) | i <- getInts (mkStdGen 0) | d <- getDoubles | l <- getLetters ] print $ take 5 ds where getInts :: StdGen -> [Int] getInts state = let (val, state') = runState getRandom state in val:(getInts state') getDoubles :: [Double] getDoubles = getDoubles' (mkStdGen 0) getDoubles' state = let (val, state') = runState getRandom state in val:(getDoubles' state') getLetters :: [Letter] getLetters = map toEnum $ randomRs (0,2) (mkStdGen 0) On Dec 15, 2014, at 8:14 AM, Erik Rantapaa wrote: > > > On Sunday, December 14, 2014 5:22:14 PM UTC-6, Michael Jones wrote: > The alternative might be to make a State Monad where the State is a tuple with each item holding the state for each generator. > > There is a common technique of using `split` and `randoms` (or `randomsR`) to create a pure list of random values which you might find helpful. Here is an example: > > {-# LANGUAGE ParallelListComp #-} > > import System.Random > > main = do > g <- newStdGen > let (g1,g2) = split g > letters = randomRs ('a','z') g1 > numbers = randomRs (15,35) g2 :: [Int] > pairs = [ (a,n) | (a,n) <- zip letters numbers ] > pairs2 = [ (a,n) | a <- letters | n <- numbers ] > print $ take 10 pairs > print $ take 10 pairs2 -- produces the same list of pairs > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Sat Dec 20 01:48:19 2014 From: david.feuer at gmail.com (David Feuer) Date: Fri, 19 Dec 2014 20:48:19 -0500 Subject: [Haskell-cafe] <*> for Data.Sequence: mission accomplished In-Reply-To: <5494BC62.1050401@gmail.com> References: <5494BC62.1050401@gmail.com> Message-ID: On Dec 19, 2014 7:01 PM, "Felipe Lessa" wrote: > - It would be nice to have at least one comment explaining the > decisions surrounding the code and how it works. I read it without > previous knowledge about how it would accomplish its goal and it was a > bit painful. It's pretty clever code! Thanks! I plan to write up a full explanation with diagrams and everything, but that will take me a bit. > - Why is ap3FT the only of the ap*FT family that cares about length fs > < 2? I wrote ap2FT and ap3FT well before I figured out how (or if!) the rest would work. I forgot to strip those cases from ap3FT. Thanks! > - Why have the ap* family of functions instead of just deconstructing > fs and wrapping Seq on apShort? Because I didn't think of it. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wojtek at power.com.pl Sat Dec 20 08:24:00 2014 From: wojtek at power.com.pl (=?UTF-8?B?V29qdGVrIE5hcmN6ecWEc2tp?=) Date: Sat, 20 Dec 2014 09:24:00 +0100 Subject: [Haskell-cafe] ECMA262 (Javascript) interpreter In-Reply-To: References: Message-ID: <54953220.6050302@power.com.pl> On 07.12.2014 06:48, Fabian Bergmark wrote: > I have been implementing an ECMA-262 (Javascript) interpreter over the > last few weeks. I have been following > http://www.ecma-international.org/ecma-262/5.1 and tried to keep my > implementation as close to the specification as possible. > Have you seen http://www.jscert.org/? It is JavaScript formal specification (JSCert) and interpreter (JSRef), written in Coq, with certain properties proven. If your goal is correctness, then it might be of interest to you. -- Wojtek From corentin.dupont at gmail.com Sat Dec 20 11:29:25 2014 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Sat, 20 Dec 2014 12:29:25 +0100 Subject: [Haskell-cafe] How to avoid keeping old data formats in your code? Message-ID: Hi, I didn't had so much luck with this question. The question was: -> "How to avoid keeping old data formats in your code?" Indeed those old data formats are often needed for retro-compatibility with previous versions of your software. Say you have a data structure that is serialized in a file, and then you add a field in a later version. You are obliged to keep both versions of the data structure if you want to be able to read both versions of the file. Potentially, if you update very often your structure between releases, you are obliged to keep N versions of the data structure in your code. See the exemple at: http://acid-state.seize.it/safecopy On Sun, Nov 30, 2014 at 1:04 PM, Corentin Dupont wrote: > Hi the list, > I have some question relative to data migration. > > Say you have a software in version A which save data in a file with format > FA. Later, you update your software to version B, with data format FB. > Now, if you want your version B of the software to be able to read data > saved by version A, you're obliged to include FA in version B, together > with some functions to translate from FA to FB. > > This is what I don't find elegant: you're obliged to keep old code (data > formats) in your software. > -> do you know of any way to avoid keeping old data formats (for > retro-compatiblilty) in your code? > > In practice I use acid-state with safecopy: > http://acid-state.seize.it/safecopy > In this example you can see the problem: the author is obliged to keep old > code (data structures) to maintain compatibility. Even worth, you might be > obliged to suffix your data structure with a version number: > > data MyType_V1 = MyType_V1 Intdata MyType_V2 = MyType_V2 Integer > > > Instead, I'm thinking of a process using GIT, or Cabal as a back-end. > The idea would be to have an additional program (or library) specialized > in the data migration of your main software. It would extract both version > A and B from the repo, and then would compile an application capable of > handling migrations from FA to FB. > > Does something like this exists (even outside of Haskell)? > > Cheers, > Corentin > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin.jan.mrotek at gmail.com Sat Dec 20 12:34:04 2014 From: marcin.jan.mrotek at gmail.com (Marcin Mrotek) Date: Sat, 20 Dec 2014 13:34:04 +0100 Subject: [Haskell-cafe] How to avoid keeping old data formats in your code? In-Reply-To: References: Message-ID: (sorry, I think I responded only to Corentin the first time) Hello, Not sure if it completely solves your problem, but perhaps try Vinyl? (https://hackage.haskell.org/package/vinyl) Adding new fields without having to change the code that doesn't need them becomes much easier. Regards, Marcin From john at degoes.net Sat Dec 20 17:58:42 2014 From: john at degoes.net (John A. De Goes) Date: Sat, 20 Dec 2014 10:58:42 -0700 Subject: [Haskell-cafe] LambdaConf 2015 - CFP Message-ID: Hi all, LambdaConf 2015?has officially opened its Call for Proposals.? LambdaConf 2015 is being held in the beautiful foothills of the Rocky Mountains, in Boulder, Colorado (home to many companies using FP). The conference is devoted to helping people become better programmers through functional and declarative programming. We're looking for lightning talks, workshops, and presentations on the following themes: FP 101. Introductory material for the FP curious or those just getting their feet wet. Languages. New languages (functional / logic), functional ways to use existing languages, language extensions, etc. Theory. Type theory, category theory, abstract algebra, ongoing or new research, and anything useful or interesting to functional programmers or academics working in the field. Libraries. Cool libraries that demonstrate the power of functional programming in helping programmers get stuff done. Case Studies. Case studies showing how using a functional language or library proved to be game-changing in solving real world problems. We currently have talks or workshops lined up for Haskell, Purescript, Scala, and Rust. If you'd like to submit a proposal, just send a private email to me or?visit the official website?for more information. We are not yet open for registrations, but we are actively looking for a couple more volunteers, as well as sponsors. If you know someone who might be interested, please spread the word! Regards, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Sat Dec 20 21:00:16 2014 From: david.feuer at gmail.com (David Feuer) Date: Sat, 20 Dec 2014 16:00:16 -0500 Subject: [Haskell-cafe] <*> for Data.Sequence: mission accomplished In-Reply-To: References: Message-ID: All but two of the special cases are gone now. -------------- next part -------------- An HTML attachment was scrubbed... URL: From qdunkan at gmail.com Sun Dec 21 00:50:22 2014 From: qdunkan at gmail.com (Evan Laforge) Date: Sat, 20 Dec 2014 16:50:22 -0800 Subject: [Haskell-cafe] How to avoid keeping old data formats in your code? In-Reply-To: References: Message-ID: On Sat, Dec 20, 2014 at 3:29 AM, Corentin Dupont wrote: > Hi, > I didn't had so much luck with this question. The question was: > -> "How to avoid keeping old data formats in your code?" > Indeed those old data formats are often needed for retro-compatibility with > previous versions of your software. > > Say you have a data structure that is serialized in a file, and then you add > a field in a later version. You are obliged to keep both versions of the > data structure if you want to be able to read both versions of the file. > Potentially, if you update very often your structure between releases, you > are obliged to keep N versions of the data structure in your code. > See the exemple at: http://acid-state.seize.it/safecopy I just keep both versions. It doesn't seem like too much hassle. I move the old version to the Serialize module so modules that aren't concerned with serialization aren't cluttered. In the fully general case, I think there's no way around it. But if you are just adding a field, or or changing a field to a super-type (e.g. 'a' becomes 'Maybe a') then you can trivially upgrade in place in the deserialization code. Or you can use something like protobufs, which supports that kind of thing automatically. From corentin.dupont at gmail.com Sun Dec 21 01:10:47 2014 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Sun, 21 Dec 2014 02:10:47 +0100 Subject: [Haskell-cafe] How to avoid keeping old data formats in your code? In-Reply-To: References: Message-ID: On Sun, Dec 21, 2014 at 1:50 AM, Evan Laforge wrote: > On Sat, Dec 20, 2014 at 3:29 AM, Corentin Dupont > wrote: > > Hi, > > I didn't had so much luck with this question. The question was: > > -> "How to avoid keeping old data formats in your code?" > > Indeed those old data formats are often needed for retro-compatibility > with > > previous versions of your software. > > > > Say you have a data structure that is serialized in a file, and then you > add > > a field in a later version. You are obliged to keep both versions of the > > data structure if you want to be able to read both versions of the file. > > Potentially, if you update very often your structure between releases, > you > > are obliged to keep N versions of the data structure in your code. > > See the exemple at: http://acid-state.seize.it/safecopy > > I just keep both versions. It doesn't seem like too much hassle. I > move the old version to the Serialize module so modules that aren't > concerned with serialization aren't cluttered. > > In the fully general case, I think there's no way around it. But if > you are just adding a field, or or changing a field to a super-type > (e.g. 'a' becomes 'Maybe a') then you can trivially upgrade in place > in the deserialization code. Or you can use something like protobufs, > which supports that kind of thing automatically. > What I'm thinking about is to put in the Setup.hs some code that will extract from GIT the older versions of the data structure. This way you are able to keep only the last version of it in the HEAD, and still be able to build migration code. Do you know of any such custom build? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fumiexcel at gmail.com Sun Dec 21 03:04:43 2014 From: fumiexcel at gmail.com (Fumiaki Kinoshita) Date: Sun, 21 Dec 2014 12:04:43 +0900 Subject: [Haskell-cafe] [ANN]Haskell Rhythm game development tutorial In-Reply-To: <549453F4.10202@fuuzetsu.co.uk> References: <549453F4.10202@fuuzetsu.co.uk> Message-ID: Thanks for the feedback. I added description for 'unsafePerformIO'. Inlined resources is still in a laboratory, but it makes sense for small applications. Maybe I'll set it up in the next release. 2014-12-20 1:36 GMT+09:00 Mateusz Kowalczyk : > On 12/19/2014 03:25 AM, Fumiaki Kinoshita wrote: > > Hello, > > > > I've published a tutorial[0] to create a rhythm game. This tutorial > focuses > > on the design of interactive, real-time application using lens, > objective, > > Call package. > > > > Feel free to point out infelicities or offer suggestion. > > > > Cheers > > > > [0] http://fumieval.github.io/rhythm-game-tutorial/ > > > > -- > > Fumiaki Kinoshita > > > > > > Hopefully I can find time to port my rhythm game to call soon. > > A small comment: ?unsafePerformIO? seems inappropriate to use without > explanation in any kind of tutorial. Maybe point out that it's there for > simplicity only. > > I also wonder whether you considered using TemplateHaskell to inline > resources at compile time: this allows us to produce a neat binary > without data files lying around which may sometimes be desirable. > > -- > Mateusz K. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From qdunkan at gmail.com Sun Dec 21 05:29:06 2014 From: qdunkan at gmail.com (Evan Laforge) Date: Sat, 20 Dec 2014 21:29:06 -0800 Subject: [Haskell-cafe] How to avoid keeping old data formats in your code? In-Reply-To: References: Message-ID: I haven't heard of anything like that, it sounds too complicated for me. You still need to convert the old format to the new one, so it seems like you still need a bit of code for each version, which needs access to both old and new. On Dec 21, 2014 9:10 AM, "Corentin Dupont" wrote: > > > On Sun, Dec 21, 2014 at 1:50 AM, Evan Laforge wrote: > >> On Sat, Dec 20, 2014 at 3:29 AM, Corentin Dupont >> wrote: >> > Hi, >> > I didn't had so much luck with this question. The question was: >> > -> "How to avoid keeping old data formats in your code?" >> > Indeed those old data formats are often needed for retro-compatibility >> with >> > previous versions of your software. >> > >> > Say you have a data structure that is serialized in a file, and then >> you add >> > a field in a later version. You are obliged to keep both versions of the >> > data structure if you want to be able to read both versions of the file. >> > Potentially, if you update very often your structure between releases, >> you >> > are obliged to keep N versions of the data structure in your code. >> > See the exemple at: http://acid-state.seize.it/safecopy >> >> I just keep both versions. It doesn't seem like too much hassle. I >> move the old version to the Serialize module so modules that aren't >> concerned with serialization aren't cluttered. >> >> In the fully general case, I think there's no way around it. But if >> you are just adding a field, or or changing a field to a super-type >> (e.g. 'a' becomes 'Maybe a') then you can trivially upgrade in place >> in the deserialization code. Or you can use something like protobufs, >> which supports that kind of thing automatically. >> > > What I'm thinking about is to put in the Setup.hs some code that will > extract from GIT the older versions of the data structure. This way you are > able to keep only the last version of it in the HEAD, and still be able to > build migration code. > Do you know of any such custom build? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From manpacket at gmail.com Sun Dec 21 08:50:00 2014 From: manpacket at gmail.com (Michael Baikov) Date: Sun, 21 Dec 2014 16:50:00 +0800 Subject: [Haskell-cafe] Template haskell: This pattern-binding binds no variables Message-ID: I'm trying to introduce a new local variable to some scope, in this example this scope is represented by print $( varE ohNoes) Everything works as expected, but I'm getting a warning message which I don't seem quite right to me. Am I doing anything wrong? ---- Blah.hs ---- {-# LANGUAGE TemplateHaskell #-} module Blah where import Language.Haskell.TH sample :: Q Exp sample = newName "ohNoes" >>= \ohNoes -> [| let $( varP ohNoes ) = "Teh warning!" in print $( varE ohNoes ) |] ---- Main.hs ---- {-# LANGUAGE TemplateHaskell #-} module Main where import Blah main :: IO () main = $( sample ) ---- output ---- Blah.hs:8:49: Warning: This pattern-binding binds no variables: $(varP ohNoes) = "Teh warning!" sample ======> let ohNoes_a2Al = "Teh warning!" in print ohNoes_a2Al From roma at ro-che.info Sun Dec 21 09:09:21 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Sun, 21 Dec 2014 11:09:21 +0200 Subject: [Haskell-cafe] How to avoid keeping old data formats in your code? In-Reply-To: References: Message-ID: <54968E41.4090704@ro-che.info> Yeah, I agree with Evan, it does sound too complicated. I also have a SafeCopy module where I keep my SafeCopy instances and old versions of data types. On 21/12/14 07:29, Evan Laforge wrote: > I haven't heard of anything like that, it sounds too complicated for me. > You still need to convert the old format to the new one, so it seems > like you still need a bit of code for each version, which needs access > to both old and new. > > On Dec 21, 2014 9:10 AM, "Corentin Dupont" > wrote: > > > > On Sun, Dec 21, 2014 at 1:50 AM, Evan Laforge > wrote: > > On Sat, Dec 20, 2014 at 3:29 AM, Corentin Dupont > > > wrote: > > Hi, > > I didn't had so much luck with this question. The question was: > > -> "How to avoid keeping old data formats in your code?" > > Indeed those old data formats are often needed for retro-compatibility with > > previous versions of your software. > > > > Say you have a data structure that is serialized in a file, and then you add > > a field in a later version. You are obliged to keep both versions of the > > data structure if you want to be able to read both versions of the file. > > Potentially, if you update very often your structure between releases, you > > are obliged to keep N versions of the data structure in your code. > > See the exemple at: http://acid-state.seize.it/safecopy > > I just keep both versions. It doesn't seem like too much hassle. I > move the old version to the Serialize module so modules that aren't > concerned with serialization aren't cluttered. > > In the fully general case, I think there's no way around it. But if > you are just adding a field, or or changing a field to a super-type > (e.g. 'a' becomes 'Maybe a') then you can trivially upgrade in place > in the deserialization code. Or you can use something like > protobufs, > which supports that kind of thing automatically. > > > What I'm thinking about is to put in the Setup.hs some code that > will extract from GIT the older versions of the data structure. This > way you are able to keep only the last version of it in the HEAD, > and still be able to build migration code. > Do you know of any such custom build? > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From vogt.adam at gmail.com Sun Dec 21 18:55:18 2014 From: vogt.adam at gmail.com (adam vogt) Date: Sun, 21 Dec 2014 13:55:18 -0500 Subject: [Haskell-cafe] Template haskell: This pattern-binding binds no variables In-Reply-To: References: Message-ID: Hi Michael, I think it's a bug. Maybe the fix is similar to the one done for https://ghc.haskell.org/trac/ghc/ticket/9127. Assuming you only need that unique name ('ohNoes :: Name) after you bind it with the let, you can avoid the warning with: sample :: Q Exp sample = [| let ohNoes = "Teh warning!" in print $( varE 'ohNoes ) |] Or you could use letE instead of the brackets, as we had to with ghc < 7.8 when PatQ splices were added. Regards, Adam On Sun, Dec 21, 2014 at 3:50 AM, Michael Baikov wrote: > I'm trying to introduce a new local variable to some scope, in this > example this scope is represented by print $( varE ohNoes) > > Everything works as expected, but I'm getting a warning message which > I don't seem quite right to me. Am I doing anything wrong? > > ---- Blah.hs ---- > {-# LANGUAGE TemplateHaskell #-} > > module Blah where > > import Language.Haskell.TH > > sample :: Q Exp > sample = newName "ohNoes" >>= \ohNoes -> [| let $( varP ohNoes ) = > "Teh warning!" in print $( varE ohNoes ) |] > > > ---- Main.hs ---- > {-# LANGUAGE TemplateHaskell #-} > > module Main where > import Blah > > main :: IO () > main = $( sample ) > > ---- output ---- > > Blah.hs:8:49: Warning: > This pattern-binding binds no variables: > $(varP ohNoes) = "Teh warning!" > > sample > ======> > let ohNoes_a2Al = "Teh warning!" in print ohNoes_a2Al > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From gautier.difolco at gmail.com Sun Dec 21 21:16:04 2014 From: gautier.difolco at gmail.com (Gautier DI FOLCO) Date: Sun, 21 Dec 2014 22:16:04 +0100 Subject: [Haskell-cafe] Parametric kinds In-Reply-To: References: Message-ID: 2014-12-17 22:54 GMT+01:00 Gautier DI FOLCO : > Hello all, > > I'm trying to port typeclasses to kind-level, here are my data types: > -- newtype Fix f a = Fix (f (Fix f a)) > -- data Mu f = In (f (Mu f)) > data Fix (f :: k1 -> k0) (n :: k1) = Fx > > data Maybe a = Nothing | Just a > > If I try to create type families to represent Functors, I end up with this: > > -- type family MapFix (f :: (* -> k) -> * -> k) a :: * where > -- type family MapFix f a where > type family MapFix (f :: (k0 -> k1) -> k0 -> k1) (a :: k2) :: * where > MapFix f (Fix a n) = Fix (f a) (MapFix f n) > > -- type family MapMaybe (f :: k -> k) (a :: Maybe k) :: Maybe k where > -- type family MapMaybe f a where > type family MapMaybe (f :: k0 -> k1) (a :: Maybe k0) :: Maybe k1 where > MapMaybe f ('Just a) = 'Just (f a) > MapMaybe f 'Nothing = 'Nothing > > But I can't defined a single open type family for these two data types. > I think I lack of parametric kinds, for example: `*k p*` could let me fit > `*Maybe k*`. Currently, in the way I see kinds, on `*k0 -> k1*` allow me > to parameterize kinds, but `*Maybe k*` doesn't fit. > > I know that this is certainly unclear, don't hesitate to ask me for > clarifications. > I also know that my `*Fix*` sucks, any good idea on how to do it is > welcome :) > Also, if you have any links to have a deeper insight of Kinds it will save > me from mental illness. > > Thanks in advance for your help, > Regards. > Hi all, I have pursued my investigations and end up with code: type family Morphism (a :: k0) (b :: k1) (c :: k2) :: * type instance Morphism t t t = t type instance Morphism A B A = B type instance Morphism B A B = A type instance Morphism D E (D a b) = E a b a :: Morphism A B A a = undefined -- Morphism A B A :: * -- = B b :: Morphism D E (D A B) b = undefined -- Morphism D E (D A B) :: * -- = forall (k :: BOX) (k :: BOX) (k :: BOX) (k :: BOX). E A B type family Morphism' (a :: k0) (b :: k1) (c :: k2) :: k3 type instance Morphism' t t t = t type instance Morphism' A B A = B type instance Morphism' B A B = A type instance Morphism' D E (D a b) = E a b a' :: Morphism' A B A a' = undefined -- Morphism' A B A :: k -- = forall (k :: BOX). Morphism' A B A They are two thing on which I want, if possible, an explanation: * Why I get a `forall k` when I declare a return polymorphic Kind? a Kind vs a' Kind * Why I get a `forall k` when I declare a parameter polymorphic Kind? a Kind vs b Kind Thanks, Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rasfar at gmail.com Sun Dec 21 22:20:30 2014 From: rasfar at gmail.com (Andrew Seniuk) Date: Sun, 21 Dec 2014 16:20:30 -0600 Subject: [Haskell-cafe] ANN: deepseq-bounded, seqaid, leaky In-Reply-To: References: Message-ID: Finally, in case the lack of constraints on dependencies put anyone off, please note that all deps in all three projects now have minimum and maximum bounds. Also, I should take this chance to note that there were no cache controls in the homepages linked above, so please force reloads in your browser to see latest versions. (The pages /now/ have caching prevention so this should not be necessary again.) And, it's nice to share your thoughts, don't you think? -Andrew On Fri, Dec 19, 2014 at 8:01 AM, Andrew Seniuk wrote: > Sorry, that was my first Reddit post and I messed up. > > Please use this link > http://www.reddit.com/r/haskell/comments/2pscxh/ann_deepseqbounded_seqaid_leaky/ > > -Andrew > > On Fri, Dec 19, 2014 at 7:07 AM, Andrew Seniuk wrote: > >> This trio of related packages explores strictness control in a variety of >> ways. >> >> deepseq-bounded provides classes and generic functions to artificially >> force evaluation, to extents controlled by static or dynamic configuration. >> >> seqaid puts that into practise, providing a GHC plugin to auto-instrument >> your package with a strictness harness, which is dynamically optimisable >> during runtime. This is supported directly in the GHC compilation >> pipeline, without requiring (or performing!) any edits to your sources. >> >> leaky is a minimal, prototypic executable that leaks space under current >> state-of-the-art compilation (GHC 7.8.3 -O2, at the present time). >> >> deepseq-bounded >> hackage: https://hackage.haskell.org/package/deepseq-bounded >> homepage: http://www.fremissant.net/deepseq-bounded >> >> seqaid >> hackage: https://hackage.haskell.org/package/seqaid >> homepage: http://www.fremissant.net/seqaid >> >> leaky >> hackage: https://hackage.haskell.org/package/leaky >> homepage: http://www.fremissant.net/leaky >> >> Reddit discussion for the three together: >> >> http://www.reddit.com/r/haskell/comments/2ps8f5/ann_deepseqbounded_seqaid_leaky/ >> >> Easiest way to try them all, is to install seqaid and run the demo: >> >> cabal install seqaid >> seqaid demo >> >> This tests seqaid on a local copy of the leaky source package. >> >> It turned out to be routine to extend deepseq-bounded and seqaid to >> dynamically configurable parallelisation (paraid?). Many other wrappers >> could be explored, too! Maybe seqaid should be renamed to koolaid or >> something... >> >> It's a pretty complicated system, and just first release, so there's >> bound to be lots of problems. I've not set up a bug tracker, but will >> maintain a casual list of bugs and feature requests at >> >> http://www.fremissant.net/seqaid/trac >> >> and will set up a proper tracker if there's interest. >> >> Any isssues (or comments), I'm here, or on the reddit discussion (or >> email). >> >> Andrew Seniuk >> rasfar on #haskell >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From manpacket at gmail.com Sun Dec 21 23:54:26 2014 From: manpacket at gmail.com (Michael Baikov) Date: Mon, 22 Dec 2014 07:54:26 +0800 Subject: [Haskell-cafe] Template haskell: This pattern-binding binds no variables In-Reply-To: References: Message-ID: I need this unique iname in other places as well. letE would work, right. I'll file a bugreport later then, Thanks! > I think it's a bug. Maybe the fix is similar to the one done for > https://ghc.haskell.org/trac/ghc/ticket/9127. > > Assuming you only need that unique name ('ohNoes :: Name) after you > bind it with the let, you can avoid the warning with: > > sample :: Q Exp > sample = [| let ohNoes = "Teh warning!" > in print $( varE 'ohNoes ) |] > > Or you could use letE instead of the brackets, as we had to with ghc < > 7.8 when PatQ splices were added. > > Regards, > Adam > > On Sun, Dec 21, 2014 at 3:50 AM, Michael Baikov wrote: >> I'm trying to introduce a new local variable to some scope, in this >> example this scope is represented by print $( varE ohNoes) >> >> Everything works as expected, but I'm getting a warning message which >> I don't seem quite right to me. Am I doing anything wrong? >> >> ---- Blah.hs ---- >> {-# LANGUAGE TemplateHaskell #-} >> >> module Blah where >> >> import Language.Haskell.TH >> >> sample :: Q Exp >> sample = newName "ohNoes" >>= \ohNoes -> [| let $( varP ohNoes ) = >> "Teh warning!" in print $( varE ohNoes ) |] >> >> >> ---- Main.hs ---- >> {-# LANGUAGE TemplateHaskell #-} >> >> module Main where >> import Blah >> >> main :: IO () >> main = $( sample ) >> >> ---- output ---- >> >> Blah.hs:8:49: Warning: >> This pattern-binding binds no variables: >> $(varP ohNoes) = "Teh warning!" >> >> sample >> ======> >> let ohNoes_a2Al = "Teh warning!" in print ohNoes_a2Al >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe From phil at darnowsky.com Mon Dec 22 00:59:49 2014 From: phil at darnowsky.com (Phil Darnowsky) Date: Sun, 21 Dec 2014 19:59:49 -0500 Subject: [Haskell-cafe] How to call hUpdateAtHNat with a value known only at runtime Message-ID: <54976D05.2040406@darnowsky.com> Hello all, I'm working on something that involves HLists where I'm making use of the hUpdateAtHNat function for array-like semantics, which works great if you know the index of the element you want at compile time: Prelude> :module +Data.HList Prelude Data.HList> let hl = hEnd $ hBuild "foobar" 123 True Loading [a bunch of packages] Prelude Data.HList> hl H["foobar", 123, True] Prelude Data.HList> hUpdateAtHNat hZero 90909 hl H[90909, 123, True] Prelude Data.HList> hUpdateAtHNat (hSucc hZero) 90909 hl H["foobar", 90909, True] Prelude Data.HList> hUpdateAtHNat (hSucc $ hSucc hZero) 90909 hl H["foobar", 123, 90909] So far so good. What's giving me trouble is figuring out how to update at an arbitrary index, where that index is only known at runtime, because hZero and hSucc are of different types: Prelude Data.HList> :t hZero hZero :: Proxy 'HZero Prelude Data.HList> :t hSucc hZero hSucc hZero :: Proxy ('HSucc 'HZero) What I'd ideally like is some kind of function intToHNatProxy that would take an Int and return a Proxy of the appropriate type, but I so far only kinda sorta understand how proxies and lifted types work, so I haven't yet succeeded in constructing one. Any advice would be very welcome. Thanks, Phil From magicloud.magiclouds at gmail.com Mon Dec 22 05:04:14 2014 From: magicloud.magiclouds at gmail.com (Magicloud Magiclouds) Date: Mon, 22 Dec 2014 13:04:14 +0800 Subject: [Haskell-cafe] Could someone help me to understand funB? In-Reply-To: References: Message-ID: I do not think pointfree works here: Transformed to pointfree style: funB = id (fix (const (flip takeWhile primes . (. join (*)) . flip (<=)))) Optimized expression: funB = id (fix (const (flip takeWhile primes . (. join (*)) . flip (<=)))) funB = fix (const (flip takeWhile primes . (. join (*)) . flip (<=))) funB = flip takeWhile primes . (. join (*)) . flip (<=) On Sat, Dec 20, 2014 at 1:21 AM, Alex Hammel wrote: > I suspect that somebody has been abusing pointfree > . > > On Thu, Dec 18, 2014 at 8:35 PM, Magicloud Magiclouds < > magicloud.magiclouds at gmail.com> wrote: >> >> Thank you. This will take some time for me to read. >> >> On Fri, Dec 19, 2014 at 12:32 PM, Lyndon Maydwell >> wrote: >>> >>> funB = flip takeWhile primes . ( . join (*)) . flip (<=) >>> >>> funB x = flip takeWhile primes ((( . join (*)) . flip (<=)) x) >>> >>> funB x = takeWhile ((( . join (*)) . flip (<=)) x) primes >>> >>> funB x = takeWhile (foo x) primes >>> >>> >>> foo x = (( . join (*)) . flip (<=)) x >>> >>> foo x = (( . join (*)) (flip (<=) x) >>> >>> foo x = flip (<=) x . join (*) >>> >>> foo x = (x <=) . join (*) >>> >>> >>> -- join :: Monad m => m (m a) -> m a >>> -- join (*) == (**2) >>> >>> foo x = (x <=) . (** 2) >>> >>> foo x y = x <= (y ** 2) >>> >>> isLessThanTheSquareOf = foo >>> >>> funB x = takeWhile (x `isLessThanTheSquareOf`) primes >>> >>> >>> Helpful? >>> >>> >>> On Fri, Dec 19, 2014 at 2:52 PM, Magicloud Magiclouds < >>> magicloud.magiclouds at gmail.com> wrote: >>> >>>> Hi, >>>> >>>> Following code is to get a list of primes. Now it is hard for me to >>>> understand funB. I mean I can see what it does. But I cannot see the >>>> detailed process by every language part. >>>> >>>> import Control.Monad >>>> >>>> isPrime :: Integer -> Bool >>>> isPrime i = ap funA funB i >>>> >>>> funA :: Integer -> [Integer] -> Bool >>>> funA x xs = all (\x' -> (mod x x') /= 0) xs >>>> >>>> funB :: Integer -> [Integer] >>>> funB = flip takeWhile primes . ( . join (*)) . flip (<=) >>>> >>>> primes :: [Integer] >>>> primes = 2 : filter isPrime [3, 5 ..] >>>> >>>> main :: IO () >>>> main = print $ take 10 primes >>>> >>>> -- >>>> ??????? >>>> ??????? >>>> >>>> And for G+, please use magiclouds#gmail.com. >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>>> >> >> -- >> ??????? >> ??????? >> >> And for G+, please use magiclouds#gmail.com. >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- ??????? ??????? And for G+, please use magiclouds#gmail.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From creichert07 at gmail.com Mon Dec 22 18:40:38 2014 From: creichert07 at gmail.com (Christopher Reichert) Date: Mon, 22 Dec 2014 12:40:38 -0600 Subject: [Haskell-cafe] Cabal Config constraints vs. constraint Message-ID: <549865a6.ed5e3c0a.48ad.ffffc962@mx.google.com> Hey everyone, I am trying to add a list of version constraints to my global cabal config (~/.cabal/config) using the `constraints` keyword. However, after adding the list to the end of the ~/.cabal/config file and running `cabal update`, I noticed this warning: $ cabal update Warning: /home/test/.cabal/config: Unrecognized field constraints on line 176 Downloading the latest package list from hackage.haskell.org I did find this issue annotated as a FIXME in the cabal source: https://github.com/haskell/cabal/blob/64761550bb617ee5d9449512bd3e500489cfd491/cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs#L408 It appears as though `constraints` are currently only supported in cabal.config (and maybe cabal.sandbox.config) Do individual constraints (e.g. `constraint:`) have the same effect as a list of constraints? Does the `constraint` setting work in both global (~/.cabal/config) and local cabal.config the exact same way (especially if I have a long list of them) Is there any reason I would use individual constraints over a list of constraints? My assumption is that they work the same way in both ~/.cabal/config && cabal.config. I'm considering patching the cabal source to support the `constraints` setting in the ~/.cabal/config file. Is there any reason this might have been passed up front? More discussion here: https://github.com/fpco/stackage-server/issues/67 Any help or advice would be greatly appreciated. Thanks, -Christopher -- Christopher Reichert irc: creichert gpg: C81D 18C8 862A 3618 1376 FFA5 6BFC A992 9955 929B -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From allbery.b at gmail.com Mon Dec 22 18:48:15 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 22 Dec 2014 13:48:15 -0500 Subject: [Haskell-cafe] Cabal Config constraints vs. constraint In-Reply-To: <549865a6.ed5e3c0a.48ad.ffffc962@mx.google.com> References: <549865a6.ed5e3c0a.48ad.ffffc962@mx.google.com> Message-ID: On Mon, Dec 22, 2014 at 1:40 PM, Christopher Reichert wrote: > Do individual constraints (e.g. `constraint:`) have the same effect as a > list of constraints? > Yes; also in cabal files, where that ability is used with conditionals. I habitually add 'constraint: foo installed' for all global packages to a new installation's ~/.cabal/config. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From mithrandi at mithrandi.net Mon Dec 22 22:48:31 2014 From: mithrandi at mithrandi.net (Tristan Seligmann) Date: Tue, 23 Dec 2014 00:48:31 +0200 Subject: [Haskell-cafe] Allocating a new ByteString Message-ID: I'm calling a function by FFI that returns two strings by writing into output buffers that you provide. The code I currently have looks like this (minus some error handling): > import qualified Data.ByteString as S > import qualified Data.ByteString.Unsafe as SU > > import Foreign.C (CChar, CInt(..), CSize(..)) > import Foreign.ForeignPtr (mallocForeignPtrBytes, withForeignPtr) > import Foreign.Ptr (Ptr) > import System.IO.Unsafe (unsafePerformIO) > > seed_keypair :: S.ByteString -> (S.ByteString, S.ByteString) > seed_keypair seed | S.length seed /= signSeed = error "seed has incorrect length" > | otherwise = unsafePerformIO $ do > pk <- mallocForeignPtrBytes signPK > sk <- mallocForeignPtrBytes signSK > SU.unsafeUseAsCString seed $ \pseed -> > withForeignPtr pk $ \ppk -> > withForeignPtr sk $ \psk -> do > 0 <- c_sign_seed_keypair ppk psk pseed > bpk <- S.packCStringLen (ppk, signPK) > bsk <- S.packCStringLen (psk, signSK) > return (bpk, bsk) > > foreign import ccall "crypto_sign_seed_keypair" > c_sign_seed_keypair :: Ptr CChar -> Ptr CChar -> Ptr CChar -> IO CInt However, this needlessly makes a copy of the output buffers to create the final result. What I really want to do is just write the string directly into a buffer allocated and used by a new ByteString; is there some way to accomplish this? (Any other comments about what I'm doing would also be appreciated, this happens to be my first attempt at using FFI!) -- mithrandi, i Ainil en-Balandor, a faer Ambar From fabian.bergmark at gmail.com Tue Dec 23 00:01:53 2014 From: fabian.bergmark at gmail.com (Fabian Bergmark) Date: Tue, 23 Dec 2014 01:01:53 +0100 Subject: [Haskell-cafe] Typesafe API calls In-Reply-To: <54934022.4000604@gmx.us> References: <54934022.4000604@gmx.us> Message-ID: I have uploaded a new version of the library https://hackage.haskell.org/package/apis-0.0.1 I'have included 15 more APIs from Facebook and Dropbox. I have also uploaded documentation to Hackage. I have been working on creating an autotools installation script that builds a makepkg package with the FFI bindings for Python and Java. I have tried it on Arch and it seems to work. If you want to try it out, check out the github repository. Building on top of this, Im working on a library that uses Pipes to create producers (triggers) and consumers (actions), allowing one to create effects (recipes) of the kind, when I am tagged in a photo on Facebook, notify me via email. This very much resembles IFTTT but with static and typesafe compositions. Im experimenting with using my javascript interpreter to allow for more dynamic compositions. 2014-12-18 21:59 GMT+01:00 Jonathan Paugh : > Hello Fabian, > > I have been dreaming of something like this for Haskell since I wrote a > (non type-safe) python library to access any REST API generically[1]. > This comes from a different (and more ambitious) angle than I had imagined. > > I don't have time to test this just now, but I will keep it bookmarked. > Thanks for sharing your hard work! > > Regards, > Jonathan > > [1]: http://github.com/jpaugh/agithub (unmaintained, but maybe interesting) > > On 12/12/2014 07:01 AM, Fabian Bergmark wrote:> I just released a > library on hackage >> (https://hackage.haskell.org/package/apis-0.0.0). The goal of the >> library is to provide typesafe API calls to a large amount of existing >> APIs. By typesafe I mean that, for each API the library provides two >> types, Input and Output, and a function :: Input -> IO Output. >> Internally the library knows how to serialize Input to make an HTTP >> request and how to deserialize the response into Output. >> >> Whats cool about this library is that it uses Template Haskell to >> generate the API interfaces. A combination of Open Data Tables, an >> internal YQL engine and JSON Schemas, all written in Haskell makes >> this possible. >> >> Right now only two APIs are included (Swedish weather data and Swedish >> public announcement), but more APIs are soon to follow. >> >> I have also implemented FFI exports of all types and functions so >> that, in combination with SWIG, this library can be used in almost any >> language. So far I have tried Java and Python with success. >> >> If anyone would like to try it and respond with feedback it would be >> greatly appreciated! If you want any specific API supported, I can try >> to import that right away >> >> Fabian Bergmark >> > From shumovichy at gmail.com Tue Dec 23 06:10:46 2014 From: shumovichy at gmail.com (Yuras Shumovich) Date: Tue, 23 Dec 2014 09:10:46 +0300 Subject: [Haskell-cafe] Allocating a new ByteString In-Reply-To: References: Message-ID: Looks like you need 'unsafePackCStringFinalizer' (or one of it's variants) from Data.ByteString.Unsafe module. It lets you reuse the buffer and deallocate it in finalizer. Something similar is used e.g. in 'kyotocabinet' package. 23 ??? 2014 ?. 1:48 ???????????? "Tristan Seligmann" < mithrandi at mithrandi.net> ???????: > I'm calling a function by FFI that returns two strings by writing into > output buffers that you provide. The code I currently have looks like > this (minus some error handling): > > > import qualified Data.ByteString as S > > import qualified Data.ByteString.Unsafe as SU > > > > import Foreign.C (CChar, CInt(..), CSize(..)) > > import Foreign.ForeignPtr (mallocForeignPtrBytes, > withForeignPtr) > > import Foreign.Ptr (Ptr) > > import System.IO.Unsafe (unsafePerformIO) > > > > seed_keypair :: S.ByteString -> (S.ByteString, S.ByteString) > > seed_keypair seed | S.length seed /= signSeed = error "seed has > incorrect length" > > | otherwise = unsafePerformIO $ do > > pk <- mallocForeignPtrBytes signPK > > sk <- mallocForeignPtrBytes signSK > > SU.unsafeUseAsCString seed $ \pseed -> > > withForeignPtr pk $ \ppk -> > > withForeignPtr sk $ \psk -> do > > 0 <- c_sign_seed_keypair ppk psk pseed > > bpk <- S.packCStringLen (ppk, signPK) > > bsk <- S.packCStringLen (psk, signSK) > > return (bpk, bsk) > > > > foreign import ccall "crypto_sign_seed_keypair" > > c_sign_seed_keypair :: Ptr CChar -> Ptr CChar -> Ptr CChar -> IO CInt > > However, this needlessly makes a copy of the output buffers to create > the final result. What I really want to do is just write the string > directly into a buffer allocated and used by a new ByteString; is > there some way to accomplish this? > > (Any other comments about what I'm doing would also be appreciated, > this happens to be my first attempt at using FFI!) > -- > mithrandi, i Ainil en-Balandor, a faer Ambar > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mithrandi at mithrandi.net Tue Dec 23 06:19:50 2014 From: mithrandi at mithrandi.net (Tristan Seligmann) Date: Tue, 23 Dec 2014 08:19:50 +0200 Subject: [Haskell-cafe] Allocating a new ByteString In-Reply-To: References: Message-ID: On 23 December 2014 at 08:10, Yuras Shumovich wrote: > Looks like you need 'unsafePackCStringFinalizer' (or one of it's variants) > from Data.ByteString.Unsafe module. It lets you reuse the buffer and > deallocate it in finalizer. Something similar is used e.g. in 'kyotocabinet' > package. I tried using this, but it seems like the pointer created by mallocForeignPtrBytes is freed as soon as it is no longer referenced (upon returning from the function). Then, later, when the bytestring is finalized, the pointer is freed again causing an abort on double-free. How do I "transfer" ownership of the pointer? -- mithrandi, i Ainil en-Balandor, a faer Ambar From shumovichy at gmail.com Tue Dec 23 06:47:07 2014 From: shumovichy at gmail.com (Yuras Shumovich) Date: Tue, 23 Dec 2014 09:47:07 +0300 Subject: [Haskell-cafe] Allocating a new ByteString In-Reply-To: References: Message-ID: <1419317227.2743.6.camel@gmail.com> On Tue, 2014-12-23 at 08:19 +0200, Tristan Seligmann wrote: > On 23 December 2014 at 08:10, Yuras Shumovich wrote: > > Looks like you need 'unsafePackCStringFinalizer' (or one of it's variants) > > from Data.ByteString.Unsafe module. It lets you reuse the buffer and > > deallocate it in finalizer. Something similar is used e.g. in 'kyotocabinet' > > package. > > I tried using this, but it seems like the pointer created by > mallocForeignPtrBytes is freed as soon as it is no longer referenced > (upon returning from the function). Then, later, when the bytestring > is finalized, the pointer is freed again causing an abort on > double-free. How do I "transfer" ownership of the pointer? 'mallocForeignPtrBytes' attaches finalizer to the 'ForeignPtr', but you need to attach it to 'ByteString'. So you can't use 'mallocForeignPtrBytes', but plain old 'malloc' (from 'Foreign.Marshal.Alloc') should work in combination with 'unsafePackMallocCStringLen'. Unless I'm missing something. Thanks, Yuras From hesselink at gmail.com Tue Dec 23 09:52:17 2014 From: hesselink at gmail.com (Erik Hesselink) Date: Tue, 23 Dec 2014 10:52:17 +0100 Subject: [Haskell-cafe] How to call hUpdateAtHNat with a value known only at runtime In-Reply-To: <54976D05.2040406@darnowsky.com> References: <54976D05.2040406@darnowsky.com> Message-ID: Hi Phil, As you kind of figured out, it's not clear what the type of your function intoToHNatProxy should be. The output type depends on the input *value*, which requires dependent types. Haskell doesn't have those (yet?). I think the best you can do is put the result in an existential, in effect saying "this has *some* type, but I don't know which one". Something like the code below. The problem is that what you can then do with the value inside the existential is more limited. It might help to know what the bigger picture is of what you're trying to do. {-# LANGUAGE GADTs #-} import Control.Applicative import Data.HList data SomeHList where SomeHList :: HList l -> SomeHList updateAtSomeN :: Int -> e -> HList l -> Maybe SomeHList updateAtSomeN _ _ HNil = Nothing updateAtSomeN 0 e (HCons _ xs) = Just $ SomeHList (HCons e xs) updateAtSomeN n e (HCons x xs) = consSomeHList x <$> updateAtSomeN (n - 1) e xs consSomeHList :: e -> SomeHList -> SomeHList consSomeHList x (SomeHList l) = SomeHList (HCons x l) Erik On Mon, Dec 22, 2014 at 1:59 AM, Phil Darnowsky wrote: > Hello all, > > I'm working on something that involves HLists where I'm making use of the > hUpdateAtHNat function for array-like semantics, which works great if you > know the index of the element you want at compile time: > > Prelude> :module +Data.HList > > Prelude Data.HList> let hl = hEnd $ hBuild "foobar" 123 True > Loading [a bunch of packages] > > Prelude Data.HList> hl > H["foobar", 123, True] > > Prelude Data.HList> hUpdateAtHNat hZero 90909 hl > H[90909, 123, True] > > Prelude Data.HList> hUpdateAtHNat (hSucc hZero) 90909 hl > H["foobar", 90909, True] > > Prelude Data.HList> hUpdateAtHNat (hSucc $ hSucc hZero) 90909 hl > H["foobar", 123, 90909] > > > So far so good. What's giving me trouble is figuring out how to update at an > arbitrary index, where that index is only known at runtime, because hZero > and hSucc are of different types: > > Prelude Data.HList> :t hZero > hZero :: Proxy 'HZero > > Prelude Data.HList> :t hSucc hZero > hSucc hZero :: Proxy ('HSucc 'HZero) > > > What I'd ideally like is some kind of function intToHNatProxy that would > take an Int and return a Proxy of the appropriate type, but I so far only > kinda sorta understand how proxies and lifted types work, so I haven't yet > succeeded in constructing one. Any advice would be very welcome. > > Thanks, > Phil > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From alois.cochard at gmail.com Tue Dec 23 11:27:01 2014 From: alois.cochard at gmail.com (Alois Cochard) Date: Tue, 23 Dec 2014 12:27:01 +0100 Subject: [Haskell-cafe] ANN: New FP meetup group in the Switzerland Romandie area Message-ID: Hey haskellers, I just wanted to let you know that I have created a new "Functional Romandie" meetup group: http://www.meetup.com/Functional-Romandie/ The aim is to gather as many as possible FP enthusiast in the area (not specific to given programming language). If you are interested please get in touch or join the meetup group! Cheers -- *?\ois* http://twitter.com/aloiscochard http://github.com/aloiscochard -------------- next part -------------- An HTML attachment was scrubbed... URL: From austin at well-typed.com Tue Dec 23 13:12:39 2014 From: austin at well-typed.com (Austin Seipp) Date: Tue, 23 Dec 2014 07:12:39 -0600 Subject: [Haskell-cafe] ANNOUNCE: GHC version 7.8.4 Message-ID: ============================================================== The (Interactive) Glasgow Haskell Compiler -- version 7.8.4 ============================================================== The GHC Team is pleased to announce a new patchlevel release of GHC, 7.8.4. This is an important bugfix release relative to 7.8.3 (with over 30 defects fixed), so we highly recommend upgrading from the previous 7.8 releases. The full release notes are here: https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/release-7-8-4.html How to get it ~~~~~~~~~~~~~ The easy way is to go to the web page, which should be self-explanatory: https://www.haskell.org/ghc/ We supply binary builds in the native package format for many platforms, and the source distribution is available from the same place. Packages will appear as they are built - if the package for your system isn't available yet, please try again later. Background ~~~~~~~~~~ Haskell is a standard lazy functional programming language. GHC is a state-of-the-art programming suite for Haskell. Included is an optimising compiler generating good code for a variety of platforms, together with an interactive system for convenient, quick development. The distribution includes space and time profiling facilities, a large collection of libraries, and support for various language extensions, including concurrency, exceptions, and foreign language interfaces (C, whatever). GHC is distributed under a BSD-style open source license. A wide variety of Haskell related resources (tutorials, libraries, specifications, documentation, compilers, interpreters, references, contact information, links to research groups) are available from the Haskell home page (see below). On-line GHC-related resources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Relevant URLs on the World-Wide Web: GHC home page http://www.haskell.org/ghc/ GHC developers' home page http://ghc.haskell.org/trac/ghc/ Haskell home page http://www.haskell.org/ Supported Platforms ~~~~~~~~~~~~~~~~~~~ The list of platforms we support, and the people responsible for them, is here: http://ghc.haskell.org/trac/ghc/wiki/Platforms http://ghc.haskell.org/trac/ghc/wiki/CodeOwners Ports to other platforms are possible with varying degrees of difficulty. The Building Guide describes how to go about porting to a new platform: http://ghc.haskell.org/trac/ghc/wiki/Building Developers ~~~~~~~~~~ We welcome new contributors. Instructions on accessing our source code repository, and getting started with hacking on GHC, are available from the GHC's developer's site run by Trac: http://ghc.haskell.org/trac/ghc/ Mailing lists ~~~~~~~~~~~~~ We run mailing lists for GHC users and bug reports; to subscribe, use the web interfaces at http://www.haskell.org/mailman/listinfo/glasgow-haskell-users http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs There are several other haskell and ghc-related mailing lists on www.haskell.org; for the full list, see http://www.haskell.org/mailman/listinfo/ Some GHC developers hang out on #haskell on IRC, too: http://www.haskell.org/haskellwiki/IRC_channel Please report bugs using our bug tracking system. Instructions on reporting bugs can be found here: http://www.haskell.org/ghc/reportabug Hashes & Signatures ~~~~~~~~~~~~~~~~~ On https://downloads.haskell.org/~ghc/7.8.4/ you will find a signed copy of the SHA256 hashes for the tarballs, using my GPG key (keyid 0x3B58D86F). -- Regards, Austin Seipp, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/ From dominic at steinitz.org Tue Dec 23 13:14:26 2014 From: dominic at steinitz.org (Dominic Steinitz) Date: Tue, 23 Dec 2014 13:14:26 +0000 Subject: [Haskell-cafe] Latest Template Haskell Breaks Package Message-ID: <1632C06F-E358-4F91-B8E7-0DA1F9706099@steinitz.org> Hello Fellow Haskellers, I have become a maintainer for yarr (https://hackage.haskell.org/package/yarr). This no longer compiles with ghc-7.8.3 because it specifies base == 4.6. Relaxing this to base >=4.6 && <4.8 tells me I need a newer version of Template Haskell > rejecting: template-haskell-2.7.0.0, 2.6.0.0, 2.5.0.0, 2.4.0.1, 2.4.0.0, > 2.3.0.1, 2.3.0.0, 2.2.0.0 (conflict: yarr => template-haskell>=2.8 && <2.9) If I now relax the constraint for Template Haskell I get a compiler error as there has been a breaking change from Template Haskell 2.9 to 2.10. > Data/Yarr/Utils/FixedVector/VecTuple.hs:45:16: > Couldn't match expected type ?TypeQ -> Q Dec? > with actual type ?Q Dec? > The function ?tySynInstD? is applied to three arguments, > but its type ?Name -> TySynEqnQ -> DecQ? has only two And indeed looking at the changes in http://git.haskell.org/packages/template-haskell.git/commitdiff/ccd7891c536b29b8bea96eb92520f46e21390e39 I can see that the function in question has changed. > -tySynInstD :: Name -> [TypeQ] -> TypeQ -> DecQ > -tySynInstD tc tys rhs = > +tySynInstD :: Name -> [TySynEqnQ] -> DecQ > +tySynInstD tc eqns = Did I miss some announcement of this breaking change and the advice on what to do about it? If I did can someone please point me at the relevant document. If not then I feel sad and would be very grateful if someone could help me as I know very little about Template Haskell. Many thanks Dominic Steinitz dominic at steinitz.org http://idontgetoutmuch.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mithrandi at mithrandi.net Tue Dec 23 16:57:46 2014 From: mithrandi at mithrandi.net (Tristan Seligmann) Date: Tue, 23 Dec 2014 18:57:46 +0200 Subject: [Haskell-cafe] Allocating a new ByteString In-Reply-To: <1419317227.2743.6.camel@gmail.com> References: <1419317227.2743.6.camel@gmail.com> Message-ID: On 23 December 2014 at 08:47, Yuras Shumovich wrote: > On Tue, 2014-12-23 at 08:19 +0200, Tristan Seligmann wrote: >> On 23 December 2014 at 08:10, Yuras Shumovich wrote: >> > Looks like you need 'unsafePackCStringFinalizer' (or one of it's variants) >> > from Data.ByteString.Unsafe module. It lets you reuse the buffer and >> > deallocate it in finalizer. Something similar is used e.g. in 'kyotocabinet' >> > package. >> >> I tried using this, but it seems like the pointer created by >> mallocForeignPtrBytes is freed as soon as it is no longer referenced >> (upon returning from the function). Then, later, when the bytestring >> is finalized, the pointer is freed again causing an abort on >> double-free. How do I "transfer" ownership of the pointer? > > 'mallocForeignPtrBytes' attaches finalizer to the 'ForeignPtr', but you > need to attach it to 'ByteString'. So you can't use > 'mallocForeignPtrBytes', but plain old 'malloc' (from > 'Foreign.Marshal.Alloc') should work in combination with > 'unsafePackMallocCStringLen'. Unless I'm missing something. Aha, that seems to work, thanks! I think I do have one minor issue left; if an exception happens in the middle of that code, the memory will never be free()d, but that should be solvable with an appropriate exception handling construction, I just need to figure out exactly what. (Actual code is here[1] if anyone is interested) [1] https://github.com/mithrandi/ssh-key-generator/blob/master/Argh.hs#L11 -- mithrandi, i Ainil en-Balandor, a faer Ambar From alfredo.dinapoli at gmail.com Tue Dec 23 17:54:52 2014 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Tue, 23 Dec 2014 18:54:52 +0100 Subject: [Haskell-cafe] Weird reachability issue with haskell.org my my Italian ISP (fastweb) Message-ID: Hello Caf?, let me start with the email I've sent to Rackspace, which will help you understand the context: Hi there! > I'm trying to understand how come I can't reach www.haskell.org from my ISP > here in Italy (fastweb). In order to troubleshoot the issue, I tried dig on > it, revealing it's hosted by you: > > dig haskell.org > > ; <<>> DiG 9.8.3-P1 <<>> haskell.org > ;; global options: +cmd > ;; Got answer: > ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63629 > ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 > ;; QUESTION SECTION: > ;haskell.org.INA > ;; ANSWER SECTION: > haskell.org. 299 IN A 23.253.242.70 > ;; Query time: 139 msec > ;; SERVER: 8.8.8.8#53(8.8.8.8) > ;; WHEN: Tue Dec 23 18:33:00 2014 > ;; MSG SIZE rcvd: 45 > > Trying a whois reveals the subnet is the entire 23.253.0.0 one: > > Rackspace Cloud Servers RACKS-8-1387376775861482 (NET-23-253-80-0-1) > 23.253.80.0 - 23.253.95.255 > Rackspace Hosting RACKS-8-NET-15 (NET-23-253-0-0-1) 23.253.0.0 - > 23.253.255.25 > > If I try to ping the IP directly, it obviously doesn't work, so I have > tried contiguous IP addresses in the same subnet to see if the subnet > itself was reachable at all.. trying 23.253.89.73 indeed worked! It > resolved to > http://www.papamurphys.com/ > This means my ISP can reach that subnet, but doesn't explain why it can't > connect to 23.253.242.70. That's very weird indeed, as every other website is reachable, only haskell.org is not! How funny my fate is! I'm one of the few Haskellers in Italy and yet I cannot access the website.. perhaps is the consequence of "Avoid success at all costs"?? :) :) Jokes aside, do you guys know (I'm asking mainly to Austin here) if rackspace uses some weird setup for their website deployment or if haskell.org is hosted "the usual way" and listening on port 80? Thanks in advance for the 1% who is concerned, for all the other 99%, merry Xmas ;) Alfredo -------------- next part -------------- An HTML attachment was scrubbed... URL: From 0slemi0 at gmail.com Tue Dec 23 23:34:34 2014 From: 0slemi0 at gmail.com (Andras Slemmer) Date: Wed, 24 Dec 2014 00:34:34 +0100 Subject: [Haskell-cafe] How to call hUpdateAtHNat with a value known only at runtime In-Reply-To: References: <54976D05.2040406@darnowsky.com> Message-ID: You can only construct such a Proxy if you hide the type itself in an existential type. Take a look at Data.Singletons, specifically the toSing function for Nat/Integer. However what you will probably find is that a Proxy like that would not be useful at all in this case. What are you *really* trying to do? If you will only know the index (and the type of the element) at runtime then what you really need is dynamic typechecking. With the Typeable constraint you can do exactly that. Take a look at Data.Typeable's 'cast' function to dynamically safely coerce your unknown data into a known element type of the HList. On 23 December 2014 at 10:52, Erik Hesselink wrote: > Hi Phil, > > As you kind of figured out, it's not clear what the type of your > function intoToHNatProxy should be. The output type depends on the > input *value*, which requires dependent types. Haskell doesn't have > those (yet?). I think the best you can do is put the result in an > existential, in effect saying "this has *some* type, but I don't know > which one". Something like the code below. The problem is that what > you can then do with the value inside the existential is more limited. > It might help to know what the bigger picture is of what you're trying > to do. > > {-# LANGUAGE GADTs #-} > import Control.Applicative > import Data.HList > > data SomeHList where > SomeHList :: HList l -> SomeHList > > updateAtSomeN :: Int -> e -> HList l -> Maybe SomeHList > updateAtSomeN _ _ HNil = Nothing > updateAtSomeN 0 e (HCons _ xs) = Just $ SomeHList (HCons e xs) > updateAtSomeN n e (HCons x xs) = consSomeHList x <$> updateAtSomeN (n - 1) > e xs > > consSomeHList :: e -> SomeHList -> SomeHList > consSomeHList x (SomeHList l) = SomeHList (HCons x l) > > Erik > > On Mon, Dec 22, 2014 at 1:59 AM, Phil Darnowsky > wrote: > > Hello all, > > > > I'm working on something that involves HLists where I'm making use of the > > hUpdateAtHNat function for array-like semantics, which works great if you > > know the index of the element you want at compile time: > > > > Prelude> :module +Data.HList > > > > Prelude Data.HList> let hl = hEnd $ hBuild "foobar" 123 True > > Loading [a bunch of packages] > > > > Prelude Data.HList> hl > > H["foobar", 123, True] > > > > Prelude Data.HList> hUpdateAtHNat hZero 90909 hl > > H[90909, 123, True] > > > > Prelude Data.HList> hUpdateAtHNat (hSucc hZero) 90909 hl > > H["foobar", 90909, True] > > > > Prelude Data.HList> hUpdateAtHNat (hSucc $ hSucc hZero) 90909 hl > > H["foobar", 123, 90909] > > > > > > So far so good. What's giving me trouble is figuring out how to update > at an > > arbitrary index, where that index is only known at runtime, because hZero > > and hSucc are of different types: > > > > Prelude Data.HList> :t hZero > > hZero :: Proxy 'HZero > > > > Prelude Data.HList> :t hSucc hZero > > hSucc hZero :: Proxy ('HSucc 'HZero) > > > > > > What I'd ideally like is some kind of function intToHNatProxy that would > > take an Int and return a Proxy of the appropriate type, but I so far only > > kinda sorta understand how proxies and lifted types work, so I haven't > yet > > succeeded in constructing one. Any advice would be very welcome. > > > > Thanks, > > Phil > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From reilithion at gmail.com Wed Dec 24 03:41:55 2014 From: reilithion at gmail.com (Lucas Paul) Date: Tue, 23 Dec 2014 20:41:55 -0700 Subject: [Haskell-cafe] FRP Tutorial Message-ID: I've been trying to get my feet wet with Functional Reactive Programming, and I'd like to play around with a library and some examples, particularly one that's already set up to work with a GUI framework like Gtk2Hs or wx. But it's been nightmarish trying to find something that works. - Grapefruit examples wouldn't compile because they were trying to import things I couldn't find in Hackage. (Codebreaker.hs, for instance) Examples using git-level stuff? - reactive-banana-wx wouldn't build because I have array-0.5 on the system level and cabal couldn't resolve dependencies. - threepenny-gui example Buttons.hs wouldn't compile (16:30: ?jsStatic? is not a (visible) constructor field name) Am I just having a run of bad luck, or is FRP really elusive right now for some reason? Should I just be learning some other GUI discipline if I want to write interfaces for my Haskell stuff? Sagely advice would be very much appreciated. - Lucas From vogt.adam at gmail.com Wed Dec 24 04:01:01 2014 From: vogt.adam at gmail.com (adam vogt) Date: Tue, 23 Dec 2014 23:01:01 -0500 Subject: [Haskell-cafe] How to call hUpdateAtHNat with a value known only at runtime In-Reply-To: <54976D05.2040406@darnowsky.com> References: <54976D05.2040406@darnowsky.com> Message-ID: Hi Phil, I think you're looking for a function that's sort of like: > withInt :: Int -> (forall (n :: HNat). Proxy n -> r) -> r > withInt 0 f = f hZero > withInt n f = withInt (n-1) (f . hSucc) But that one is pretty useless because you can't even supply hNat2Integral as the second argument: > withInt 5 hNat2Integral Could not deduce (HNat2Integral n) arising from a use of ?hNat2Integral? from the context (Integral r) That expression typechecks (and gives the value 5 back) if we add that missing constraint: > withInt :: Int -> (forall (n :: HNat). HNat2Integral n => Proxy n -> r) -> r That's fine, but I don't have a solution for HUpdateAtHNat. The problem is that the constraint you bring along has to work with any 'n' but HUpdateAtHNat doesn't typecheck if you try to update beyond the end of the list, so when I write: withIntUp :: HUpdateAtHNat HZero e l => Proxy '(e,l) -> Int -> (forall (n :: HNat). HUpdateAtHNat n e l => Proxy n -> r) -> r withIntUp _ 0 f = f hZero withIntUp p n f = withIntUp p (n-1) (f . hSucc) There's a type error: Could not deduce (HUpdateAtHNat ('HSucc n) e l) arising from a use of ?f? from the context (HUpdateAtHNat 'HZero e l) Another sort of solution is http://lpaste.net/117131, but it's unpleasant to put more things into an ApplyAB instance than you have to. Regards, Adam On Sun, Dec 21, 2014 at 7:59 PM, Phil Darnowsky wrote: > Hello all, > > I'm working on something that involves HLists where I'm making use of the > hUpdateAtHNat function for array-like semantics, which works great if you > know the index of the element you want at compile time: > > Prelude> :module +Data.HList > > Prelude Data.HList> let hl = hEnd $ hBuild "foobar" 123 True > Loading [a bunch of packages] > > Prelude Data.HList> hl > H["foobar", 123, True] > > Prelude Data.HList> hUpdateAtHNat hZero 90909 hl > H[90909, 123, True] > > Prelude Data.HList> hUpdateAtHNat (hSucc hZero) 90909 hl > H["foobar", 90909, True] > > Prelude Data.HList> hUpdateAtHNat (hSucc $ hSucc hZero) 90909 hl > H["foobar", 123, 90909] > > > So far so good. What's giving me trouble is figuring out how to update at an > arbitrary index, where that index is only known at runtime, because hZero > and hSucc are of different types: > > Prelude Data.HList> :t hZero > hZero :: Proxy 'HZero > > Prelude Data.HList> :t hSucc hZero > hSucc hZero :: Proxy ('HSucc 'HZero) > > > What I'd ideally like is some kind of function intToHNatProxy that would > take an Int and return a Proxy of the appropriate type, but I so far only > kinda sorta understand how proxies and lifted types work, so I haven't yet > succeeded in constructing one. Any advice would be very welcome. > > Thanks, > Phil > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From briand at aracnet.com Wed Dec 24 07:03:19 2014 From: briand at aracnet.com (briand at aracnet.com) Date: Tue, 23 Dec 2014 23:03:19 -0800 Subject: [Haskell-cafe] is gldrawingarea an instance of widgetclass Message-ID: <20141223230319.36f96749@pebble.deldotd.com> I get this : No instance for (Gtk.WidgetClass GtkGL.GLDrawingArea) arising from a use of `Gtk.boxPackStart' in code that was compiling at one point. This is how I'm importing import qualified Graphics.UI.Gtk.OpenGL as GtkGL then glCanvas <- GtkGL.glDrawingAreaNew glconfig and use it thusly: Gtk.boxPackStart hBox1 glCanvas Gtk.PackNatural 0 boxPackStart wants something WidgetClass, and GLDrawingArea seems to be an instance of widget class. The gtkglext hasn't been touched in quite a while. I'm wondering if it's become out of date with the latest gtk. ?? Thanks, Brian From briand at aracnet.com Wed Dec 24 07:05:00 2014 From: briand at aracnet.com (briand at aracnet.com) Date: Tue, 23 Dec 2014 23:05:00 -0800 Subject: [Haskell-cafe] FRP Tutorial In-Reply-To: References: Message-ID: <20141223230500.09c0dbf0@pebble.deldotd.com> On Tue, 23 Dec 2014 20:41:55 -0700 Lucas Paul wrote: > I've been trying to get my feet wet with Functional Reactive > Programming, and I'd like to play around with a library and some > examples, particularly one that's already set up to work with a GUI > framework like Gtk2Hs or wx. But it's been nightmarish trying to find > something that works. > > - Grapefruit examples wouldn't compile because they were trying to > import things I couldn't find in Hackage. (Codebreaker.hs, for > instance) Examples using git-level stuff? > > - reactive-banana-wx wouldn't build because I have array-0.5 on the > system level and cabal couldn't resolve dependencies. > > - threepenny-gui example Buttons.hs wouldn't compile (16:30: > ?jsStatic? is not a (visible) constructor field name) > > Am I just having a run of bad luck, or is FRP really elusive right now > for some reason? Should I just be learning some other GUI discipline > if I want to write interfaces for my Haskell stuff? > > Sagely advice would be very much appreciated. > I can't offer advice, but I'm certainly interested in the answer. Brian From k-bx at k-bx.com Wed Dec 24 07:06:06 2014 From: k-bx at k-bx.com (Konstantine Rybnikov) Date: Wed, 24 Dec 2014 09:06:06 +0200 Subject: [Haskell-cafe] Building fresh cabal-install on raspberry-pi Message-ID: Hi! I just got raspberry pi and installed debian wheezy on it. It has ghc 7.4.1 with cabal 1.14.0. I tried to do cabal install cabal-install and got this: ``` In-place registering Cabal-1.20.0.3... Installing library in /home/pi/.cabal/lib/arm-linux-ghc-7.4.1/Cabal-1.20.0.3 Registering Cabal-1.20.0.3... Downloading cabal-install-1.20.0.4... Configuring cabal-install-1.20.0.4... cabal: At least the following dependencies are missing: random >=1 && <1.1 && ==1.1 cabal: Error: some packages failed to install: cabal-install-1.20.0.4 failed during the configure step. The exception was: ``` If I do `cabal list --installed | less` and search for random I see: ``` * random Synopsis: random number library Default available version: 1.1 Installed versions: 1.0.1.1, 1.1 License: BSD3 ``` Can anyone please help how do I resolve this and similar problems? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From shumovichy at gmail.com Wed Dec 24 08:46:35 2014 From: shumovichy at gmail.com (Yuras Shumovich) Date: Wed, 24 Dec 2014 11:46:35 +0300 Subject: [Haskell-cafe] is gldrawingarea an instance of widgetclass In-Reply-To: <20141223230319.36f96749@pebble.deldotd.com> References: <20141223230319.36f96749@pebble.deldotd.com> Message-ID: <1419410795.2794.6.camel@gmail.com> On Tue, 2014-12-23 at 23:03 -0800, briand at aracnet.com wrote: > I get this : > > No instance for (Gtk.WidgetClass GtkGL.GLDrawingArea) > arising from a use of `Gtk.boxPackStart' > > in code that was compiling at one point. > This is how I'm importing > > import qualified Graphics.UI.Gtk.OpenGL as GtkGL Is your code cabalized? If not, then probably you indirectly depend on different versions of gtk. For example, GLDrawingArea is instance of WidgetClass from one version of gtk, but you need the instance from other version of gtk. Check `ghc-pkg list gtk`. There is a number of related questions on SO, e.g. http://stackoverflow.com/questions/27301221/haskell-http-client-using-bytestring/27301808#27301808 Thanks, Yuras > > then > > glCanvas <- GtkGL.glDrawingAreaNew glconfig > > and use it thusly: > > Gtk.boxPackStart hBox1 glCanvas Gtk.PackNatural 0 > > boxPackStart wants something WidgetClass, and GLDrawingArea seems to be an instance of widget class. > > The gtkglext hasn't been touched in quite a while. I'm wondering if it's become out of date with the latest gtk. > > ?? > > > Thanks, > > Brian > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From lambda.fairy at gmail.com Wed Dec 24 09:49:15 2014 From: lambda.fairy at gmail.com (Chris Wong) Date: Wed, 24 Dec 2014 22:49:15 +1300 Subject: [Haskell-cafe] Building fresh cabal-install on raspberry-pi In-Reply-To: References: Message-ID: Hi Konstantine, You're experiencing a phenomenon commonly known as "dependency hell". The usual and most straightforward solution is to nuke ~/.cabal and ~/.ghc and reinstall. In the future, you should aim to install as many packages as possible in one go, so that Cabal can ensure they work together up front. Also, if you have multiple projects going, consider using Cabal sandboxes to keep them separate. These links might help: * https://cdsmith.wordpress.com/2011/01/17/the-butterfly-effect-in-cabal/ * http://www.vex.net/~trebla/haskell/sicp.xhtml * http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html Chris On Wed, Dec 24, 2014 at 8:06 PM, Konstantine Rybnikov wrote: > Hi! I just got raspberry pi and installed debian wheezy on it. It has ghc > 7.4.1 with cabal 1.14.0. > > I tried to do cabal install cabal-install and got this: > > ``` > In-place registering Cabal-1.20.0.3... > Installing library in /home/pi/.cabal/lib/arm-linux-ghc-7.4.1/Cabal-1.20.0.3 > Registering Cabal-1.20.0.3... > Downloading cabal-install-1.20.0.4... > Configuring cabal-install-1.20.0.4... > cabal: At least the following dependencies are missing: > random >=1 && <1.1 && ==1.1 > cabal: Error: some packages failed to install: > cabal-install-1.20.0.4 failed during the configure step. The exception was: > ``` > > If I do `cabal list --installed | less` and search for random I see: > > ``` > * random > Synopsis: random number library > Default available version: 1.1 > Installed versions: 1.0.1.1, 1.1 > License: BSD3 > ``` > > Can anyone please help how do I resolve this and similar problems? > > Thanks! > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- https://lambda.xyz From apfelmus at quantentunnel.de Wed Dec 24 09:54:50 2014 From: apfelmus at quantentunnel.de (Heinrich Apfelmus) Date: Wed, 24 Dec 2014 10:54:50 +0100 Subject: [Haskell-cafe] FRP Tutorial In-Reply-To: References: Message-ID: Lucas Paul wrote: > I've been trying to get my feet wet with Functional Reactive > Programming, and I'd like to play around with a library and some > examples, particularly one that's already set up to work with a GUI > framework like Gtk2Hs or wx. But it's been nightmarish trying to find > something that works. > > - Grapefruit examples wouldn't compile because they were trying to > import things I couldn't find in Hackage. (Codebreaker.hs, for > instance) Examples using git-level stuff? > > - reactive-banana-wx wouldn't build because I have array-0.5 on the > system level and cabal couldn't resolve dependencies. > > - threepenny-gui example Buttons.hs wouldn't compile (16:30: > ?jsStatic? is not a (visible) constructor field name) Author of reactive-banana and threepenny-gui here. One of the design goals of Threepenny is to be dead simple to install. Please keep reporting things that don't work. In your case: Are you trying to run the Button.hs file from github? This one is coded against version 0.6.*, which has not been released on Hackage yet. Please use the Button.hs file included in http://hackage.haskell.org/package/threepenny-gui-0.5.0.0 instead, or run the threepenny-examples-buttons executable. As for reactive-banana-wx: There's a reason I started Threepenny. :) Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com From max.voit+mlhc at with-eyes.net Wed Dec 24 11:57:10 2014 From: max.voit+mlhc at with-eyes.net (Max Voit) Date: Wed, 24 Dec 2014 12:57:10 +0100 Subject: [Haskell-cafe] FRP Tutorial In-Reply-To: References: Message-ID: <20141224125710.7c9157d4@veeloqu.lan> On Wed, 24 Dec 2014 10:54:50 +0100 Heinrich Apfelmus wrote: > As for reactive-banana-wx: There's a reason I started Threepenny. :) Regarding this issue: Could you please clarify this (ideally on the threepenny and reactive-banana github pages)? I have looked into these projects from time to time and was quite confused by all the dependency changes (threepenny being now standalone without relation to reactive-banana, if i understood correctly). I guess a clear note would be helpful to a lot of people looking for a FRP library. kind regards, max From dct25-561bs at mythic-beasts.com Wed Dec 24 12:42:03 2014 From: dct25-561bs at mythic-beasts.com (David Turner) Date: Wed, 24 Dec 2014 12:42:03 +0000 Subject: [Haskell-cafe] HPC and Template Haskell (GHC 7.8.3, Yesod) In-Reply-To: References: Message-ID: Hi all, Turns out this was already a known issue in GHC: https://ghc.haskell.org/trac/ghc/ticket/9762 and a fix is now on the way for 7.10.1. In the meantime, adding -fomit-interface-pragmas works for me. Thanks, David On 19 December 2014 at 20:28, David Turner wrote: > Ok, I can reproduce this with a bare Yesod scaffold (using the latest > cabal-install) - see below. > > If I run cabal build a couple more times, it completes successfully, > which is mighty strange! > > > [linuxadmin at vm01 20:19:43 ~ ] > $ yesod init > Welcome to the Yesod scaffolder. > I'm going to be creating a skeleton Yesod project for you. > > What do you want to call your project? We'll use this for the cabal name. > > Project name: linker-test > Yesod uses Persistent for its (you guessed it) persistence layer. > This tool will build in either SQLite or PostgreSQL or MongoDB support for you. > We recommend starting with SQLite: it has no dependencies. > > s = sqlite > p = postgresql > pf = postgresql + Fay (experimental) > mongo = mongodb > mysql = MySQL > simple = no database, no auth > url = Let me specify URL containing a site (advanced) > > So, what'll it be? simple > That's it! I'm creating your files now... > > --------------------------------------- > > ___ > {-) |\ > [m,].-"-. / > [][__][__] \(/\__/\)/ > [__][__][__][__]~~~~ | | > [][__][__][__][__][] / | > [__][__][__][__][__]| /| | > [][__][__][__][__][]| || | ~~~~ > ejm [__][__][__][__][__]__,__, \__/ > > > --------------------------------------- > > The foundation for your web application has been built. > > > There are a lot of resources to help you use Yesod. > Start with the book: http://www.yesodweb.com/book > Take part in the community: http://yesodweb.com/page/community > > > It's highly recommended to follow the quick start guide for > installing Yesod: http://www.yesodweb.com/page/quickstart > > If your system is already configured correctly, please run: > > cd linker-test && cabal install -j --enable-tests > --max-backjumps=-1 --reorder-goals && yesod devel > [linuxadmin at vm01 20:20:07 ~ ] > $ cd linker-test > [linuxadmin at vm01 20:20:11 ~/linker-test ] > $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal configure > --disable-tests --enable-coverage --disable-profiling > Resolving dependencies... > Configuring linker-test-0.0.0... > [linuxadmin at vm01 20:20:25 ~/linker-test ] > $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal build > Building linker-test-0.0.0... > Preprocessing library linker-test-0.0.0... > [1 of 7] Compiling Settings.Development ( Settings/Development.hs, > dist/build/Settings/Development.o ) > [2 of 7] Compiling Settings ( Settings.hs, dist/build/Settings.o ) > Loading package ghc-prim ... linking ... done. > Loading package integer-gmp ... linking ... done. > Loading package base ... linking ... done. > Loading package array-0.5.0.0 ... linking ... done. > Loading package stm-2.4.3 ... linking ... done. > Loading package async-2.0.1.6 ... linking ... done. > Loading package deepseq-1.3.0.2 ... linking ... done. > Loading package bytestring-0.10.4.0 ... linking ... done. > Loading package containers-0.5.5.1 ... linking ... done. > Loading package text-1.1.1.3 ... linking ... done. > Loading package hashable-1.2.2.0 ... linking ... done. > Loading package scientific-0.3.3.2 ... linking ... done. > Loading package attoparsec-0.12.1.2 ... linking ... done. > Loading package base64-bytestring-1.0.0.1 ... linking ... done. > Loading package blaze-builder-0.3.3.4 ... linking ... done. > Loading package byteable-0.1.1 ... linking ... done. > Loading package transformers-0.3.0.0 ... linking ... done. > Loading package mtl-2.1.3.1 ... linking ... done. > Loading package exceptions-0.6.1 ... linking ... done. > Loading package base-unicode-symbols-0.2.2.4 ... linking ... done. > Loading package transformers-base-0.4.3 ... linking ... done. > Loading package monad-control-0.3.3.0 ... linking ... done. > Loading package lifted-base-0.2.2.1 ... linking ... done. > Loading package mmorph-1.0.4 ... linking ... done. > Loading package resourcet-1.1.3 ... linking ... done. > Loading package nats-0.2 ... linking ... done. > Loading package unordered-containers-0.2.5.1 ... linking ... done. > Loading package semigroups-0.15.4 ... linking ... done. > Loading package void-0.6.1 ... linking ... done. > Loading package conduit-1.2.3 ... linking ... done. > Loading package filepath-1.3.0.2 ... linking ... done. > Loading package old-locale-1.0.0.6 ... linking ... done. > Loading package time-1.4.2 ... linking ... done. > Loading package unix-2.7.0.1 ... linking ... done. > Loading package directory-1.2.1.0 ... linking ... done. > Loading package parsec-3.1.7 ... linking ... done. > Loading package network-2.5.0.0 ... linking ... done. > Loading package primitive-0.5.4.0 ... linking ... done. > Loading package process-1.2.0.0 ... linking ... done. > Loading package random-1.0.1.1 ... linking ... done. > Loading package zlib-0.5.4.2 ... linking ... done. > Loading package streaming-commons-0.1.6 ... linking ... done. > Loading package conduit-extra-1.1.4.2 ... linking ... done. > Loading package cryptohash-0.11.6 ... linking ... done. > Loading package cryptohash-conduit-0.1.1 ... linking ... done. > Loading package css-text-0.1.2.1 ... linking ... done. > Loading package data-default-class-0.0.1 ... linking ... done. > Loading package data-default-instances-base-0.0.1 ... linking ... done. > Loading package data-default-instances-containers-0.0.1 ... linking ... done. > Loading package dlist-0.7.1 ... linking ... done. > Loading package data-default-instances-dlist-0.0.1 ... linking ... done. > Loading package data-default-instances-old-locale-0.0.1 ... linking ... done. > Loading package data-default-0.5.3 ... linking ... done. > Loading package pretty-1.1.1.1 ... linking ... done. > Loading package template-haskell ... linking ... done. > Loading package file-embed-0.0.7 ... linking ... done. > Loading package utf8-string-0.3.8 ... linking ... done. > Loading package language-javascript-0.5.13 ... linking ... done. > Loading package hjsmin-0.1.4.7 ... linking ... done. > Loading package case-insensitive-1.2.0.1 ... linking ... done. > Loading package http-types-0.8.5 ... linking ... done. > Loading package mime-types-0.1.0.4 ... linking ... done. > Loading package old-time-1.1.0.2 ... linking ... done. > Loading package system-filepath-0.4.12 ... linking ... done. > Loading package system-fileio-0.3.15 ... linking ... done. > Loading package unix-compat-0.4.1.3 ... linking ... done. > Loading package vault-0.3.0.3 ... linking ... done. > Loading package wai-3.0.2 ... linking ... done. > Loading package blaze-markup-0.6.1.1 ... linking ... done. > Loading package blaze-html-0.7.0.3 ... linking ... done. > Loading package http-date-0.0.4 ... linking ... done. > Loading package ansi-terminal-0.6.2.1 ... linking ... done. > Loading package ansi-wl-pprint-0.6.7.1 ... linking ... done. > Loading package transformers-compat-0.3.3.3 ... linking ... done. > Loading package optparse-applicative-0.11.0.1 ... linking ... done. > Loading package auto-update-0.1.2 ... linking ... done. > Loading package fast-logger-2.2.3 ... linking ... done. > Loading package stringsearch-0.3.6.5 ... linking ... done. > Loading package byteorder-1.0.4 ... linking ... done. > Loading package easy-file-0.2.0 ... linking ... done. > Loading package binary-0.7.1.0 ... linking ... done. > Loading package unix-time-0.3.4 ... linking ... done. > Loading package wai-logger-2.2.3 ... linking ... done. > Loading package word8-0.1.1 ... linking ... done. > Loading package wai-extra-3.0.2.1 ... linking ... done. > Loading package simple-sendfile-0.2.18 ... linking ... done. > Loading package warp-3.0.2.3 ... linking ... done. > Loading package wai-app-static-3.0.0.3 ... linking ... done. > Loading package syb-0.4.2 ... linking ... done. > Loading package vector-0.10.12.1 ... linking ... done. > Loading package aeson-0.8.0.2 ... linking ... done. > Loading package cereal-0.4.1.0 ... linking ... done. > Loading package securemem-0.1.4 ... linking ... done. > Loading package crypto-cipher-types-0.0.9 ... linking ... done. > Loading package cipher-aes-0.2.9 ... linking ... done. > Loading package crypto-random-0.0.8 ... linking ... done. > Loading package cprng-aes-0.6.1 ... linking ... done. > Loading package entropy-0.3.4.1 ... linking ... done. > Loading package tagged-0.7.3 ... linking ... done. > Loading package crypto-api-0.13.2 ... linking ... done. > Loading package setenv-0.1.1.1 ... linking ... done. > Loading package skein-1.0.9.1 ... linking ... done. > Loading package clientsession-0.9.1.1 ... linking ... done. > Loading package cookie-0.4.1.4 ... linking ... done. > Loading package monad-loops-0.4.2.1 ... linking ... done. > Loading package stm-chans-3.0.0.2 ... linking ... done. > Loading package monad-logger-0.3.9 ... linking ... done. > Loading package mwc-random-0.13.2.2 ... linking ... done. > Loading package path-pieces-0.1.4 ... linking ... done. > Loading package safe-0.3.8 ... linking ... done. > Loading package shakespeare-2.0.2.1 ... linking ... done. > Loading package yesod-core-1.4.4.5 ... linking ... done. > Loading package yesod-static-1.4.0.3 ... linking ... done. > Loading package yaml-0.8.10 ... linking ... done. > Loading package publicsuffixlist-0.1 ... linking ... done. > Loading package http-client-0.4.5 ... linking ... done. > Loading package socks-0.5.4 ... linking ... done. > Loading package hourglass-0.2.6 ... linking ... done. > Loading package asn1-types-0.3.0 ... linking ... done. > Loading package asn1-encoding-0.9.0 ... linking ... done. > Loading package cipher-des-0.0.6 ... linking ... done. > Loading package cipher-rc4-0.1.4 ... linking ... done. > Loading package crypto-numbers-0.2.3 ... linking ... done. > Loading package crypto-pubkey-types-0.4.2.3 ... linking ... done. > Loading package crypto-pubkey-0.2.4 ... linking ... done. > Loading package asn1-parse-0.9.0 ... linking ... done. > Loading package pem-0.2.2 ... linking ... done. > Loading package x509-1.5.0.1 ... linking ... done. > Loading package x509-store-1.5.0 ... linking ... done. > Loading package x509-validation-1.5.1 ... linking ... done. > Loading package tls-1.2.13 ... linking ... done. > Loading package x509-system-1.5.0 ... linking ... done. > Loading package connection-0.2.3 ... linking ... done. > Loading package http-client-tls-0.2.2 ... linking ... done. > Loading package http-conduit-2.1.5 ... linking ... done. > Loading package xml-types-0.3.4 ... linking ... done. > Loading package xml-conduit-1.2.3 ... linking ... done. > Loading package tagstream-conduit-0.5.5.3 ... linking ... done. > Loading package authenticate-1.3.2.10 ... linking ... done. > Loading package base16-bytestring-0.1.1.6 ... linking ... done. > Loading package email-validate-2.0.1 ... linking ... done. > Loading package mime-mail-0.4.6 ... linking ... done. > Loading package resource-pool-0.2.3.1 ... linking ... done. > Loading package silently-1.2.4.1 ... linking ... done. > Loading package persistent-2.1.1 ... linking ... done. > Loading package persistent-template-2.1 ... linking ... done. > Loading package tagsoup-0.13.3 ... linking ... done. > Loading package xss-sanitize-0.3.5.4 ... linking ... done. > Loading package yesod-persistent-1.4.0.1 ... linking ... done. > Loading package yesod-form-1.4.1.1 ... linking ... done. > Loading package yesod-auth-1.4.1 ... linking ... done. > Loading package yesod-1.4.1 ... linking ... done. > [3 of 7] Compiling Settings.StaticFiles ( Settings/StaticFiles.hs, > dist/build/Settings/StaticFiles.o ) > [4 of 7] Compiling Foundation ( Foundation.hs, dist/build/Foundation.o ) > [5 of 7] Compiling Import ( Import.hs, dist/build/Import.o ) > [6 of 7] Compiling Handler.Home ( Handler/Home.hs, > dist/build/Handler/Home.o ) > [7 of 7] Compiling Application ( Application.hs, dist/build/Application.o ) > /usr/bin/ld: dist/build/Foundation.dyn_o: relocation R_X86_64_PC32 > against undefined symbol > `_hpc_tickboxes_linkerzmtestzm0zi0zi0_Settings_hpc' can not be used > when making a shared object; recompile with -fPIC > /usr/bin/ld: final link failed: Bad value > collect2: error: ld returned 1 exit status > > : ghc: phase `Linker' failed (exitcode = 1) > [linuxadmin at vm01 20:20:38 ~/linker-test ] > $ > > On 19 December 2014 at 20:21, David Turner wrote: >> Ok, I can reproduce this with a bare Yesod scaffold: >> >> [linuxadmin at vm01 20:19:43 ~ ] >> $ yesod init >> Welcome to the Yesod scaffolder. >> I'm going to be creating a skeleton Yesod project for you. >> >> What do you want to call your project? We'll use this for the cabal name. >> >> Project name: linker-test >> Yesod uses Persistent for its (you guessed it) persistence layer. >> This tool will build in either SQLite or PostgreSQL or MongoDB support for you. >> We recommend starting with SQLite: it has no dependencies. >> >> s = sqlite >> p = postgresql >> pf = postgresql + Fay (experimental) >> mongo = mongodb >> mysql = MySQL >> simple = no database, no auth >> url = Let me specify URL containing a site (advanced) >> >> So, what'll it be? simple >> That's it! I'm creating your files now... >> >> --------------------------------------- >> >> ___ >> {-) |\ >> [m,].-"-. / >> [][__][__] \(/\__/\)/ >> [__][__][__][__]~~~~ | | >> [][__][__][__][__][] / | >> [__][__][__][__][__]| /| | >> [][__][__][__][__][]| || | ~~~~ >> ejm [__][__][__][__][__]__,__, \__/ >> >> >> --------------------------------------- >> >> The foundation for your web application has been built. >> >> >> There are a lot of resources to help you use Yesod. >> Start with the book: http://www.yesodweb.com/book >> Take part in the community: http://yesodweb.com/page/community >> >> >> It's highly recommended to follow the quick start guide for >> installing Yesod: http://www.yesodweb.com/page/quickstart >> >> If your system is already configured correctly, please run: >> >> cd linker-test && cabal install -j --enable-tests >> --max-backjumps=-1 --reorder-goals && yesod devel >> [linuxadmin at vm01 20:20:07 ~ ] >> $ cd linker-test >> [linuxadmin at vm01 20:20:11 ~/linker-test ] >> $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal configure >> --disable-tests --enable-coverage --disable-profiling >> Resolving dependencies... >> Configuring linker-test-0.0.0... >> [linuxadmin at vm01 20:20:25 ~/linker-test ] >> $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal build >> Building linker-test-0.0.0... >> Preprocessing library linker-test-0.0.0... >> [1 of 7] Compiling Settings.Development ( Settings/Development.hs, >> dist/build/Settings/Development.o ) >> [2 of 7] Compiling Settings ( Settings.hs, dist/build/Settings.o ) >> Loading package ghc-prim ... linking ... done. >> Loading package integer-gmp ... linking ... done. >> Loading package base ... linking ... done. >> Loading package array-0.5.0.0 ... linking ... done. >> Loading package stm-2.4.3 ... linking ... done. >> Loading package async-2.0.1.6 ... linking ... done. >> Loading package deepseq-1.3.0.2 ... linking ... done. >> Loading package bytestring-0.10.4.0 ... linking ... done. >> Loading package containers-0.5.5.1 ... linking ... done. >> Loading package text-1.1.1.3 ... linking ... done. >> Loading package hashable-1.2.2.0 ... linking ... done. >> Loading package scientific-0.3.3.2 ... linking ... done. >> Loading package attoparsec-0.12.1.2 ... linking ... done. >> Loading package base64-bytestring-1.0.0.1 ... linking ... done. >> Loading package blaze-builder-0.3.3.4 ... linking ... done. >> Loading package byteable-0.1.1 ... linking ... done. >> Loading package transformers-0.3.0.0 ... linking ... done. >> Loading package mtl-2.1.3.1 ... linking ... done. >> Loading package exceptions-0.6.1 ... linking ... done. >> Loading package base-unicode-symbols-0.2.2.4 ... linking ... done. >> Loading package transformers-base-0.4.3 ... linking ... done. >> Loading package monad-control-0.3.3.0 ... linking ... done. >> Loading package lifted-base-0.2.2.1 ... linking ... done. >> Loading package mmorph-1.0.4 ... linking ... done. >> Loading package resourcet-1.1.3 ... linking ... done. >> Loading package nats-0.2 ... linking ... done. >> Loading package unordered-containers-0.2.5.1 ... linking ... done. >> Loading package semigroups-0.15.4 ... linking ... done. >> Loading package void-0.6.1 ... linking ... done. >> Loading package conduit-1.2.3 ... linking ... done. >> Loading package filepath-1.3.0.2 ... linking ... done. >> Loading package old-locale-1.0.0.6 ... linking ... done. >> Loading package time-1.4.2 ... linking ... done. >> Loading package unix-2.7.0.1 ... linking ... done. >> Loading package directory-1.2.1.0 ... linking ... done. >> Loading package parsec-3.1.7 ... linking ... done. >> Loading package network-2.5.0.0 ... linking ... done. >> Loading package primitive-0.5.4.0 ... linking ... done. >> Loading package process-1.2.0.0 ... linking ... done. >> Loading package random-1.0.1.1 ... linking ... done. >> Loading package zlib-0.5.4.2 ... linking ... done. >> Loading package streaming-commons-0.1.6 ... linking ... done. >> Loading package conduit-extra-1.1.4.2 ... linking ... done. >> Loading package cryptohash-0.11.6 ... linking ... done. >> Loading package cryptohash-conduit-0.1.1 ... linking ... done. >> Loading package css-text-0.1.2.1 ... linking ... done. >> Loading package data-default-class-0.0.1 ... linking ... done. >> Loading package data-default-instances-base-0.0.1 ... linking ... done. >> Loading package data-default-instances-containers-0.0.1 ... linking ... done. >> Loading package dlist-0.7.1 ... linking ... done. >> Loading package data-default-instances-dlist-0.0.1 ... linking ... done. >> Loading package data-default-instances-old-locale-0.0.1 ... linking ... done. >> Loading package data-default-0.5.3 ... linking ... done. >> Loading package pretty-1.1.1.1 ... linking ... done. >> Loading package template-haskell ... linking ... done. >> Loading package file-embed-0.0.7 ... linking ... done. >> Loading package utf8-string-0.3.8 ... linking ... done. >> Loading package language-javascript-0.5.13 ... linking ... done. >> Loading package hjsmin-0.1.4.7 ... linking ... done. >> Loading package case-insensitive-1.2.0.1 ... linking ... done. >> Loading package http-types-0.8.5 ... linking ... done. >> Loading package mime-types-0.1.0.4 ... linking ... done. >> Loading package old-time-1.1.0.2 ... linking ... done. >> Loading package system-filepath-0.4.12 ... linking ... done. >> Loading package system-fileio-0.3.15 ... linking ... done. >> Loading package unix-compat-0.4.1.3 ... linking ... done. >> Loading package vault-0.3.0.3 ... linking ... done. >> Loading package wai-3.0.2 ... linking ... done. >> Loading package blaze-markup-0.6.1.1 ... linking ... done. >> Loading package blaze-html-0.7.0.3 ... linking ... done. >> Loading package http-date-0.0.4 ... linking ... done. >> Loading package ansi-terminal-0.6.2.1 ... linking ... done. >> Loading package ansi-wl-pprint-0.6.7.1 ... linking ... done. >> Loading package transformers-compat-0.3.3.3 ... linking ... done. >> Loading package optparse-applicative-0.11.0.1 ... linking ... done. >> Loading package auto-update-0.1.2 ... linking ... done. >> Loading package fast-logger-2.2.3 ... linking ... done. >> Loading package stringsearch-0.3.6.5 ... linking ... done. >> Loading package byteorder-1.0.4 ... linking ... done. >> Loading package easy-file-0.2.0 ... linking ... done. >> Loading package binary-0.7.1.0 ... linking ... done. >> Loading package unix-time-0.3.4 ... linking ... done. >> Loading package wai-logger-2.2.3 ... linking ... done. >> Loading package word8-0.1.1 ... linking ... done. >> Loading package wai-extra-3.0.2.1 ... linking ... done. >> Loading package simple-sendfile-0.2.18 ... linking ... done. >> Loading package warp-3.0.2.3 ... linking ... done. >> Loading package wai-app-static-3.0.0.3 ... linking ... done. >> Loading package syb-0.4.2 ... linking ... done. >> Loading package vector-0.10.12.1 ... linking ... done. >> Loading package aeson-0.8.0.2 ... linking ... done. >> Loading package cereal-0.4.1.0 ... linking ... done. >> Loading package securemem-0.1.4 ... linking ... done. >> Loading package crypto-cipher-types-0.0.9 ... linking ... done. >> Loading package cipher-aes-0.2.9 ... linking ... done. >> Loading package crypto-random-0.0.8 ... linking ... done. >> Loading package cprng-aes-0.6.1 ... linking ... done. >> Loading package entropy-0.3.4.1 ... linking ... done. >> Loading package tagged-0.7.3 ... linking ... done. >> Loading package crypto-api-0.13.2 ... linking ... done. >> Loading package setenv-0.1.1.1 ... linking ... done. >> Loading package skein-1.0.9.1 ... linking ... done. >> Loading package clientsession-0.9.1.1 ... linking ... done. >> Loading package cookie-0.4.1.4 ... linking ... done. >> Loading package monad-loops-0.4.2.1 ... linking ... done. >> Loading package stm-chans-3.0.0.2 ... linking ... done. >> Loading package monad-logger-0.3.9 ... linking ... done. >> Loading package mwc-random-0.13.2.2 ... linking ... done. >> Loading package path-pieces-0.1.4 ... linking ... done. >> Loading package safe-0.3.8 ... linking ... done. >> Loading package shakespeare-2.0.2.1 ... linking ... done. >> Loading package yesod-core-1.4.4.5 ... linking ... done. >> Loading package yesod-static-1.4.0.3 ... linking ... done. >> Loading package yaml-0.8.10 ... linking ... done. >> Loading package publicsuffixlist-0.1 ... linking ... done. >> Loading package http-client-0.4.5 ... linking ... done. >> Loading package socks-0.5.4 ... linking ... done. >> Loading package hourglass-0.2.6 ... linking ... done. >> Loading package asn1-types-0.3.0 ... linking ... done. >> Loading package asn1-encoding-0.9.0 ... linking ... done. >> Loading package cipher-des-0.0.6 ... linking ... done. >> Loading package cipher-rc4-0.1.4 ... linking ... done. >> Loading package crypto-numbers-0.2.3 ... linking ... done. >> Loading package crypto-pubkey-types-0.4.2.3 ... linking ... done. >> Loading package crypto-pubkey-0.2.4 ... linking ... done. >> Loading package asn1-parse-0.9.0 ... linking ... done. >> Loading package pem-0.2.2 ... linking ... done. >> Loading package x509-1.5.0.1 ... linking ... done. >> Loading package x509-store-1.5.0 ... linking ... done. >> Loading package x509-validation-1.5.1 ... linking ... done. >> Loading package tls-1.2.13 ... linking ... done. >> Loading package x509-system-1.5.0 ... linking ... done. >> Loading package connection-0.2.3 ... linking ... done. >> Loading package http-client-tls-0.2.2 ... linking ... done. >> Loading package http-conduit-2.1.5 ... linking ... done. >> Loading package xml-types-0.3.4 ... linking ... done. >> Loading package xml-conduit-1.2.3 ... linking ... done. >> Loading package tagstream-conduit-0.5.5.3 ... linking ... done. >> Loading package authenticate-1.3.2.10 ... linking ... done. >> Loading package base16-bytestring-0.1.1.6 ... linking ... done. >> Loading package email-validate-2.0.1 ... linking ... done. >> Loading package mime-mail-0.4.6 ... linking ... done. >> Loading package resource-pool-0.2.3.1 ... linking ... done. >> Loading package silently-1.2.4.1 ... linking ... done. >> Loading package persistent-2.1.1 ... linking ... done. >> Loading package persistent-template-2.1 ... linking ... done. >> Loading package tagsoup-0.13.3 ... linking ... done. >> Loading package xss-sanitize-0.3.5.4 ... linking ... done. >> Loading package yesod-persistent-1.4.0.1 ... linking ... done. >> Loading package yesod-form-1.4.1.1 ... linking ... done. >> Loading package yesod-auth-1.4.1 ... linking ... done. >> Loading package yesod-1.4.1 ... linking ... done. >> [3 of 7] Compiling Settings.StaticFiles ( Settings/StaticFiles.hs, >> dist/build/Settings/StaticFiles.o ) >> [4 of 7] Compiling Foundation ( Foundation.hs, dist/build/Foundation.o ) >> [5 of 7] Compiling Import ( Import.hs, dist/build/Import.o ) >> [6 of 7] Compiling Handler.Home ( Handler/Home.hs, >> dist/build/Handler/Home.o ) >> [7 of 7] Compiling Application ( Application.hs, dist/build/Application.o ) >> /usr/bin/ld: dist/build/Foundation.dyn_o: relocation R_X86_64_PC32 >> against undefined symbol >> `_hpc_tickboxes_linkerzmtestzm0zi0zi0_Settings_hpc' can not be used >> when making a shared object; recompile with -fPIC >> /usr/bin/ld: final link failed: Bad value >> collect2: error: ld returned 1 exit status >> >> : ghc: phase `Linker' failed (exitcode = 1) >> [linuxadmin at vm01 20:20:38 ~/linker-test ] >> $ >> >> On 19 December 2014 at 20:03, David Turner >> wrote: >>> [Failed to copy haskell-cafe in to my first response:] >>> >>> I thought I had disabled profiling there, although it was enabled when >>> I was using cabal which wrote the original command line so that might >>> explain it. >>> >>> I will try a more recent cabal-install this evening. >>> >>> Thanks for the speedy response! >>> >>> [Time passes - second response:] >>> >>> I have tried cabal-install build from the latest revision (4aabb4f4b1) >>> with the same result. From a clean checkout of my source: >>> >>> $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal configure >>> --disable-tests --enable-coverage --disable-profiling >>> $ ~/cabal/cabal-install/.cabal-sandbox/bin/cabal build -v >>> >>> Similar outcome. >>> >>> >>> >>> >>> On 19 December 2014 at 18:53, Carter Schonwald >>> wrote: >>>> i think the fix for this, or a related problem is merged into >>>> cabal/cabal-install head, and will be in 1.22 >>>> >>>> does your problem go away if you dont enable profiled builds? (is so, its >>>> likely the same problem) >>>> >>>> On Fri, Dec 19, 2014 at 1:32 PM, David Turner >>>> wrote: >>>>> >>>>> Hi, >>>>> >>>>> I'm having trouble making a HPC build of a Yesod application. It fails >>>>> with: >>>>> >>>>> /usr/bin/ld: dist/build/StreamReading/Config.dyn_o: relocation >>>>> R_X86_64_PC32 against undefined symbol >>>>> `_hpc_tickboxes_tracszmenterprisezm0zi0zi0_Settings_hpc' can not be >>>>> used when making a shared object; recompile with -fPIC >>>>> >>>>> I've narrowed it down to a call to ghc and posted the output in all >>>>> its gory detail at http://lpaste.net/116872 if that's any help. >>>>> >>>>> Of note is that dist/build/Settings.dyn_o is unexpectedly missing from >>>>> the list of parameters to the last call to gcc, and the missing symbol >>>>> is defined in the same. There are, in fact, quite a number of missing >>>>> .dyn_o files in that list. >>>>> >>>>> Slightly weirdly, when I run the same command line again, it seems to >>>>> work. At least, there are no errors reported and the exit code is 0. >>>>> >>>>> Any ideas? >>>>> >>>>> Cheers, >>>>> >>>>> David >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> Haskell-Cafe at haskell.org >>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>>> From apfelmus at quantentunnel.de Wed Dec 24 13:33:52 2014 From: apfelmus at quantentunnel.de (Heinrich Apfelmus) Date: Wed, 24 Dec 2014 14:33:52 +0100 Subject: [Haskell-cafe] FRP Tutorial In-Reply-To: <20141224125710.7c9157d4@veeloqu.lan> References: <20141224125710.7c9157d4@veeloqu.lan> Message-ID: Max Voit wrote: > Heinrich Apfelmus wrote: > >> As for reactive-banana-wx: There's a reason I started Threepenny. :) > > Regarding this issue: Could you please clarify this (ideally on the > threepenny and reactive-banana github pages)? I have looked into these > projects from time to time and was quite confused by all the dependency > changes (threepenny being now standalone without relation to > reactive-banana, if i understood correctly). I guess a clear note would > be helpful to a lot of people looking for a FRP library. Well, there are FRP (functional reactive programming) libraries and there are GUI (graphical user interface) libraries. While the two go well together, these are really two separate concepts. Which one of the two are you looking for? reactive-banana = FRP only reactive-banana-wx = connects a GUI library and an FRP library threepenny = mainly GUI, but includes a small FRP part I will try to make the distinction more clear on the project homepage (to which the github pages link), but I can't guarantee that there will be less confusion for people who are completely new to these ideas. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com From dburke.gw at gmail.com Wed Dec 24 14:49:27 2014 From: dburke.gw at gmail.com (Doug Burke) Date: Wed, 24 Dec 2014 09:49:27 -0500 Subject: [Haskell-cafe] How best to deal with Monoid/Applicative changes in 7.10 in a backwards-compatable way Message-ID: I'm trying out the ghc 7.10 RC and am seeing lots of warnings about Monoid and some symbols from Control.Applicative - e.g. The import of ?Data.Monoid? is redundant except perhaps to import instances from ?Data.Monoid? To import instances alone, use: import Data.Monoid() For now I'm wrapping the import with some CPP so that it will still compile with older ghc versions (and a probably-pointless attempt to be non-ghc-specific, since I have never tested my code with other compilers): #if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) import Control.Applicative (Applicative(pure), (<$>), (<*>)) import Data.Monoid (Monoid(..)) #else import Control.Applicative ((<$>)) #endif Is this the best way? Am I missing something really obvious? Thanks, Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From shumovichy at gmail.com Wed Dec 24 15:51:37 2014 From: shumovichy at gmail.com (Yuras Shumovich) Date: Wed, 24 Dec 2014 18:51:37 +0300 Subject: [Haskell-cafe] How best to deal with Monoid/Applicative changes in 7.10 in a backwards-compatable way In-Reply-To: References: Message-ID: <1419436297.2794.16.camel@gmail.com> On Wed, 2014-12-24 at 09:49 -0500, Doug Burke wrote: > I'm trying out the ghc 7.10 RC and am seeing lots of warnings about Monoid > and some symbols from Control.Applicative - e.g. > > The import of ?Data.Monoid? is redundant > except perhaps to import instances from ?Data.Monoid? > To import instances alone, use: import Data.Monoid() > > For now I'm wrapping the import with some CPP so that it will still compile > with older ghc versions (and a probably-pointless attempt to be > non-ghc-specific, since I have never tested my code with other compilers): > > #if (!defined(__GLASGOW_HASKELL__)) || (__GLASGOW_HASKELL__ < 710) > import Control.Applicative (Applicative(pure), (<$>), (<*>)) > import Data.Monoid (Monoid(..)) > #else > import Control.Applicative ((<$>)) > #endif > > Is this the best way? Am I missing something really obvious? I don't even have plans to adopt ghc-7.10 yet, so I don't know the best way to handle that. But for similar issue I usually avoid CPP at use side. It is better to make compatibility layer that hides all the CPP. I successfully used that approach to handle `catch` removal from `Prelude`. I have `Prelude.hs` visible to ghc with the next contents: > {-# LANGUAGE PackageImports #-} > {-# LANGUAGE CPP #-} > > module Prelude > ( > module P > ) > where > > #if MIN_VERSION_base(4,6,0) > import "base" Prelude as P > #else > import "base" Prelude as P hiding (catch) > #endif I think the same trick can be used to handle AMP changes. E.g. you can add "Control/Monad.hs" file that reexports `Control.Applicative`. Probably you can avoid CPP altogether if you specify different `hs-source-dirs` for different ghc versions in cabal file. Thanks, Yuras > > Thanks, > Doug > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Wed Dec 24 15:57:35 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 24 Dec 2014 15:57:35 +0000 Subject: [Haskell-cafe] Building fresh cabal-install on raspberry-pi In-Reply-To: References: Message-ID: <20141224155735.GD31575@weber> On Wed, Dec 24, 2014 at 10:49:15PM +1300, Chris Wong wrote: > You're experiencing a phenomenon commonly known as "dependency hell". > The usual and most straightforward solution is to nuke ~/.cabal and > ~/.ghc and reinstall. YMMV but I've always had good results just deleting .ghc and leaving .cabal alone. (I have GHC and Cabal install globally by my Debian distribution package manager, if that makes any difference.) Tom From carter.schonwald at gmail.com Wed Dec 24 15:59:05 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 24 Dec 2014 10:59:05 -0500 Subject: [Haskell-cafe] Building fresh cabal-install on raspberry-pi In-Reply-To: <20141224155735.GD31575@weber> References: <20141224155735.GD31575@weber> Message-ID: indeed, as tom says, never nuke ~/.cabal, just ~/.ghc (because thats always safe) On Wed, Dec 24, 2014 at 10:57 AM, Tom Ellis < tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote: > On Wed, Dec 24, 2014 at 10:49:15PM +1300, Chris Wong wrote: > > You're experiencing a phenomenon commonly known as "dependency hell". > > The usual and most straightforward solution is to nuke ~/.cabal and > > ~/.ghc and reinstall. > > YMMV but I've always had good results just deleting .ghc and leaving .cabal > alone. (I have GHC and Cabal install globally by my Debian distribution > package manager, if that makes any difference.) > > Tom > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From briand at aracnet.com Wed Dec 24 17:09:02 2014 From: briand at aracnet.com (briand at aracnet.com) Date: Wed, 24 Dec 2014 09:09:02 -0800 Subject: [Haskell-cafe] is gldrawingarea an instance of widgetclass In-Reply-To: <1419410795.2794.6.camel@gmail.com> References: <20141223230319.36f96749@pebble.deldotd.com> <1419410795.2794.6.camel@gmail.com> Message-ID: <20141224090902.44db506f@pebble.deldotd.com> On Wed, 24 Dec 2014 11:46:35 +0300 Yuras Shumovich wrote: > On Tue, 2014-12-23 at 23:03 -0800, briand at aracnet.com wrote: > > I get this : > > > > No instance for (Gtk.WidgetClass GtkGL.GLDrawingArea) > > arising from a use of `Gtk.boxPackStart' > > > > in code that was compiling at one point. > > This is how I'm importing > > > > import qualified Graphics.UI.Gtk.OpenGL as GtkGL > > Is your code cabalized? If not, then probably you indirectly depend on > different versions of gtk. For example, GLDrawingArea is instance of > WidgetClass from one version of gtk, but you need the instance from > other version of gtk. Check `ghc-pkg list gtk`. ah. ok. i bet this is due to the fact that i'm using the debian install of ghc and a locally upgraded cabal. i've never been able to get the debian ghc and cabal to coexist happily. i always end up purging it and compiling my own local ghc. Looks like i'm back to doing that. Brian From k-bx at k-bx.com Thu Dec 25 07:40:48 2014 From: k-bx at k-bx.com (Konstantine Rybnikov) Date: Thu, 25 Dec 2014 09:40:48 +0200 Subject: [Haskell-cafe] Building fresh cabal-install on raspberry-pi In-Reply-To: References: Message-ID: Thanks, Chris and everybody else. The thing is, and I just finished to re-check, that this error happens even after I did `rm ~/.ghc; rm ~/.cabal`, so this happens upon fresh install. Thanks for links, I will spend some time later to learn to get more understanding on what exactly goes wrong. On Wed, Dec 24, 2014 at 11:49 AM, Chris Wong wrote: > Hi Konstantine, > > You're experiencing a phenomenon commonly known as "dependency hell". > The usual and most straightforward solution is to nuke ~/.cabal and > ~/.ghc and reinstall. > > In the future, you should aim to install as many packages as possible > in one go, so that Cabal can ensure they work together up front. Also, > if you have multiple projects going, consider using Cabal sandboxes to > keep them separate. > > These links might help: > * https://cdsmith.wordpress.com/2011/01/17/the-butterfly-effect-in-cabal/ > * http://www.vex.net/~trebla/haskell/sicp.xhtml > * http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html > > Chris > > On Wed, Dec 24, 2014 at 8:06 PM, Konstantine Rybnikov > wrote: > > Hi! I just got raspberry pi and installed debian wheezy on it. It has ghc > > 7.4.1 with cabal 1.14.0. > > > > I tried to do cabal install cabal-install and got this: > > > > ``` > > In-place registering Cabal-1.20.0.3... > > Installing library in > /home/pi/.cabal/lib/arm-linux-ghc-7.4.1/Cabal-1.20.0.3 > > Registering Cabal-1.20.0.3... > > Downloading cabal-install-1.20.0.4... > > Configuring cabal-install-1.20.0.4... > > cabal: At least the following dependencies are missing: > > random >=1 && <1.1 && ==1.1 > > cabal: Error: some packages failed to install: > > cabal-install-1.20.0.4 failed during the configure step. The exception > was: > > ``` > > > > If I do `cabal list --installed | less` and search for random I see: > > > > ``` > > * random > > Synopsis: random number library > > Default available version: 1.1 > > Installed versions: 1.0.1.1, 1.1 > > License: BSD3 > > ``` > > > > Can anyone please help how do I resolve this and similar problems? > > > > Thanks! > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > > -- > https://lambda.xyz > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon at joyful.com Thu Dec 25 19:55:30 2014 From: simon at joyful.com (Simon Michael) Date: Thu, 25 Dec 2014 11:55:30 -0800 Subject: [Haskell-cafe] ANN: hledger 0.24 Message-ID: <9157EB6A-2919-4793-B26F-2B6031FED321@joyful.com> Happy Christmas/Holidays/New Year all! I?m pleased to announce hledger and hledger-web 0.24. Highlights of this release include: CSV export, a non-floating point number representation, more powerful account aliases, speedups, and a streamlined web UI. Release notes: http://hledger.org/release-notes.html#hledger-0.24 Release contributors: Simon Michael, Julien Moutinho, Ryan Desfosses, Gergely Risko, Gwern. Installation: cabal install hledger[-web] or see http://hledger.org/download hledger (http://hledger.org) is a command-line tool, web app and haskell library for tracking and reporting on financial transactions, stored in a human-readable plain text format. It can also read CSV or timelog files, and export CSV. It provides useful reports and can also help you record new transactions interactively. Add-on commands include hledger-irr (for calculating internal rate of return) and hledger-interest (for generating interest transactions). hledger is inspired by and largely compatible with Ledger. I wish you a very merry, balanced and prosperous 2015. -Simon From rwallace at thewallacepack.net Thu Dec 25 23:34:19 2014 From: rwallace at thewallacepack.net (Richard Wallace) Date: Thu, 25 Dec 2014 16:34:19 -0700 Subject: [Haskell-cafe] Encoding for flow charts Message-ID: Hello, I've been working to encode a fairly complex flow chart. At first I took the simple approach of having a single data type for the possible states data S = S0 | S1 | S2 and then a simple recursive function to step through it loop :: Monad m => S -> StateT s m Result loop S0 = testS0 >>= \r -> if r then loop S1 else loop S2 loop S1 = s1Result loop S2 = s2Result This works well enough, but with the size of the flow chart I'm working with (50+ decision points) it quickly becomes clear that it's probably not the most best way to do it. One problem that I'd like to solve is being able to test each decision point in isolation, making sure that decision point `m` will go to decision point `n` when it is supposed to, without having to run through the whole rest of the flow chart that would otherwise follow. Something else I'd like to achieve is being able to organize the decisions into separate modules - much better than having just the one big function above. Here's what I've come up with as an alternative so far. data Step a b where TrueFlow :: Decision a d e => a -> Step a b FalseFlow :: Decision b f g => b -> Step a b Done :: Result -> Step a b class Decision a b c | a -> b, a -> c where decide :: (Functor m, Monad m) => a -> StateT s m (Step b c) data S0 = S0 deriving (Show, Eq) instance Decision S0 S1 S2 where decide _ = bool (FalseFlow S2) (TrueFlow S1) <$> testS0 data S1 = S1 deriving (Show, Eq) instance Decision S1 () () where decide _ = s1Result data S2 = S2 deriving (Show, Eq) instance Decision S2 () () where decide _ = s2Result decision :: (Functor m, Monad m, Decision a b c) => a -> StateT s m Result decision s = decide s >>= \case TrueFlow b -> decision b FalseFlow c -> decision c Done s -> return s With this implementation it is easy to test a single decision point, - just use `evalStateT (decide S0) s` and compare the resulting Step to make sure it is either S1 or S2. The logic can also be easily separated and organized into modules. The biggest drawback of this new approach is the need to create a new `Step` record at every decision point. In the end, this may be worth it for the added design benefits, but would love to be able to get rid of it and find a solution that gives the added benefits without incurring any performance penalties. Any suggestions anyone can give on improvements would be greatly appreciated. Thanks! Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Fri Dec 26 03:36:07 2014 From: info at rotnetix.com (Riaan) Date: Fri, 26 Dec 2014 14:36:07 +1100 Subject: [Haskell-cafe] Handling Postgresql array types Message-ID: This is a question about database query libraries. I am trying to do some analytics on a Postgresql database and up to now have been using Database.HDBC for most of my querying. One of the columns on the database is a two dimensional float8 array. I tried using Database.PostgreSQL.Simple but got stuck on this array as I could not figure out how to extend the built in conversion functions to cater for something like this. So went back to HDBC. But now my queries are starting to get fairly long and I have been looking at libraries like Persistent with Esqualeto, HaskellDB and Groundhog to make my queries a little more composable and type safe. However I have not been able to find any examples of any of these libraries using postgres arrays and given my postgresql-simple experience I worried that I might similarly be unable, because of my low level of haskell ability, to extend the conversion functions. So to my question. Does anyone have experience with one of these libraries in dealing with postgresql arrays and could someone perhaps send me a simple example that I could use as a basis. Failing that, can anyone advise me on which of these libraries have the most haskell newbie (LYAH trained, but still struggling with RWH) friendly approach to writing new conversion functions? Thanks Riaan -------------- next part -------------- An HTML attachment was scrubbed... URL: From amit at amitlevy.com Fri Dec 26 06:22:50 2014 From: amit at amitlevy.com (Amit Aryeh Levy) Date: Thu, 25 Dec 2014 22:22:50 -0800 Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: References: Message-ID: <549CFEBA.2030100@amitlevy.com> I doubt you'd need to extend the built-in conversion functions for postgresql-simple. In particular there is already an instance fo `ToField` for: `ToField a => ToField (Vector a)` meaning there is an instance for the type `Vector (Vector Float)` (because `Float` is also an instance of `ToField`). I believe that should work out of the box for you. I've never tried using two dimensional arrays, but I've used postgresql arrays as Vectors using postgresql-simple a lot, and it works great out of the box. If you're interested in going just a little bit higher level without abandoning postgresql-simple, I'd suggest postgresql-orm (shameless plug), which gives you an very lightweight ORM layer on top of postgresql-simple -- specifically a safe query DSL. -Amit On 12/25/2014 07:36 PM, Riaan wrote: > This is a question about database query libraries. I am trying to do > some analytics on a Postgresql database and up to now have been using > Database.HDBC for most of my querying. > > One of the columns on the database is a two dimensional float8 array. > I tried using Database.PostgreSQL.Simple but got stuck on this array > as I could not figure out how to extend the built in conversion > functions to cater for something like this. So went back to HDBC. > But now my queries are starting to get fairly long and I have been > looking at libraries like Persistent with Esqualeto, HaskellDB and > Groundhog to make my queries a little more composable and type safe. > > However I have not been able to find any examples of any of these > libraries using postgres arrays and given my postgresql-simple > experience I worried that I might similarly be unable, because of my > low level of haskell ability, to extend the conversion functions. > > So to my question. Does anyone have experience with one of these > libraries in dealing with postgresql arrays and could someone perhaps > send me a simple example that I could use as a basis. Failing that, > can anyone advise me on which of these libraries have the most haskell > newbie (LYAH trained, but still struggling with RWH) friendly approach > to writing new conversion functions? > > Thanks > Riaan > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From k-bx at k-bx.com Fri Dec 26 08:29:34 2014 From: k-bx at k-bx.com (Konstantine Rybnikov) Date: Fri, 26 Dec 2014 10:29:34 +0200 Subject: [Haskell-cafe] ghc 7.10.1-rc1 ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format. Message-ID: Hi! I just did `sudo make install` on ghc 7.10.1-rc1, removed ~/.ghc and did `cabal update`. I'm now trying to upgrade to latest cabal by issuing `cabal install cabal-install`. I get the following: ``` ... on the commandline: Warning: -package-name is deprecated: Use -this-package-key instead ghc: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format. Failed to install zlib-0.5.4.2 cabal: Error: some packages failed to install: HTTP-3001.0.4 depends on text-1.2.0.3 which failed to install. cabal-install-0.4.0 depends on zlib-0.5.4.2 which failed to install. mtl-2.2.1 failed during the building phase. The exception was: ExitFailure 1 network-2.6.0.2 failed during the building phase. The exception was: ExitFailure 1 parsec-3.1.7 depends on text-1.2.0.3 which failed to install. text-1.2.0.3 failed during the building phase. The exception was: ExitFailure 1 zlib-0.5.4.2 failed during the building phase. The exception was: ExitFailure 1 ``` Does anyone know a quick-fix? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From k-bx at k-bx.com Fri Dec 26 08:30:25 2014 From: k-bx at k-bx.com (Konstantine Rybnikov) Date: Fri, 26 Dec 2014 10:30:25 +0200 Subject: [Haskell-cafe] ghc 7.10.1-rc1 ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format. In-Reply-To: References: Message-ID: Ubuntu 14.04 64-bit, btw, and haskell from https://downloads.haskell.org/~ghc/7.10.1-rc1/ghc-7.10.0.20141222-x86_64-unknown-linux-deb7.tar.xz On Fri, Dec 26, 2014 at 10:29 AM, Konstantine Rybnikov wrote: > Hi! > > I just did `sudo make install` on ghc 7.10.1-rc1, removed ~/.ghc and did > `cabal update`. I'm now trying to upgrade to latest cabal by issuing `cabal > install cabal-install`. I get the following: > > ``` > ... > on the commandline: Warning: > -package-name is deprecated: Use -this-package-key instead > ghc: ghc no longer supports single-file style package databases > (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with > the correct format. > Failed to install zlib-0.5.4.2 > cabal: Error: some packages failed to install: > HTTP-3001.0.4 depends on text-1.2.0.3 which failed to install. > cabal-install-0.4.0 depends on zlib-0.5.4.2 which failed to install. > mtl-2.2.1 failed during the building phase. The exception was: > ExitFailure 1 > network-2.6.0.2 failed during the building phase. The exception was: > ExitFailure 1 > parsec-3.1.7 depends on text-1.2.0.3 which failed to install. > text-1.2.0.3 failed during the building phase. The exception was: > ExitFailure 1 > zlib-0.5.4.2 failed during the building phase. The exception was: > ExitFailure 1 > ``` > > Does anyone know a quick-fix? > > Thanks! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at snoyman.com Fri Dec 26 08:31:42 2014 From: michael at snoyman.com (Michael Snoyman) Date: Fri, 26 Dec 2014 08:31:42 +0000 Subject: [Haskell-cafe] ghc 7.10.1-rc1 ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format. References: Message-ID: I believe that means you need to upgrade to cabal-install 1.22. On Fri, Dec 26, 2014, 10:30 AM Konstantine Rybnikov wrote: > Hi! > > I just did `sudo make install` on ghc 7.10.1-rc1, removed ~/.ghc and did > `cabal update`. I'm now trying to upgrade to latest cabal by issuing `cabal > install cabal-install`. I get the following: > > ``` > ... > on the commandline: Warning: > -package-name is deprecated: Use -this-package-key instead > ghc: ghc no longer supports single-file style package databases > (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with > the correct format. > Failed to install zlib-0.5.4.2 > cabal: Error: some packages failed to install: > HTTP-3001.0.4 depends on text-1.2.0.3 which failed to install. > cabal-install-0.4.0 depends on zlib-0.5.4.2 which failed to install. > mtl-2.2.1 failed during the building phase. The exception was: > ExitFailure 1 > network-2.6.0.2 failed during the building phase. The exception was: > ExitFailure 1 > parsec-3.1.7 depends on text-1.2.0.3 which failed to install. > text-1.2.0.3 failed during the building phase. The exception was: > ExitFailure 1 > zlib-0.5.4.2 failed during the building phase. The exception was: > ExitFailure 1 > ``` > > Does anyone know a quick-fix? > > Thanks! > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.tetley at gmail.com Fri Dec 26 08:39:39 2014 From: stephen.tetley at gmail.com (Stephen Tetley) Date: Fri, 26 Dec 2014 08:39:39 +0000 Subject: [Haskell-cafe] Encoding for flow charts In-Reply-To: References: Message-ID: Hi Richard It might be worth looking at Wyatt Allan and Martin Erwig's Surveyor DSEL for alternative design ideas. The authors directly encode questions rather than states which, without looking closely, seems more natural to me - I think you could envisage flow diagrams as specializations of "surveys". The paper is available from Martin's website: http://web.engr.oregonstate.edu/~erwig/papers/abstracts.html Best wishes Stephen On 25 December 2014 at 23:34, Richard Wallace wrote: > Hello, > > I've been working to encode a fairly complex flow chart. At first I took the > simple approach of having a single data type for the possible states > > data S = S0 | S1 | S2 > > and then a simple recursive function to step through it > > loop :: Monad m => S -> StateT s m Result > loop S0 = testS0 >>= \r -> if r then loop S1 else loop S2 > loop S1 = s1Result > loop S2 = s2Result > > This works well enough, but with the size of the flow chart I'm working with > (50+ decision points) it quickly becomes clear that it's probably not the > most best way to do it. One problem that I'd like to solve is being able to > test each decision point in isolation, making sure that decision point `m` > will go to decision point `n` when it is supposed to, without having to run > through the whole rest of the flow chart that would otherwise follow. > Something else I'd like to achieve is being able to organize the decisions > into separate modules - much better than having just the one big function > above. > > Here's what I've come up with as an alternative so far. > > data Step a b where > TrueFlow :: Decision a d e => a -> Step a b > FalseFlow :: Decision b f g => b -> Step a b > Done :: Result -> Step a b > > class Decision a b c | a -> b, a -> c where > decide :: (Functor m, Monad m) => a -> StateT s m (Step b c) > > data S0 = S0 deriving (Show, Eq) > instance Decision S0 S1 S2 where > decide _ = bool (FalseFlow S2) (TrueFlow S1) <$> testS0 > > data S1 = S1 deriving (Show, Eq) > instance Decision S1 () () where > decide _ = s1Result > > data S2 = S2 deriving (Show, Eq) > instance Decision S2 () () where > decide _ = s2Result > > decision :: (Functor m, Monad m, Decision a b c) > => a > -> StateT s m Result > decision s = decide s >>= \case > TrueFlow b -> decision b > FalseFlow c -> decision c > Done s -> return s > > With this implementation it is easy to test a single decision point, - just > use `evalStateT (decide S0) s` and compare the resulting Step to make sure > it is either S1 or S2. The logic can also be easily separated and organized > into modules. > > The biggest drawback of this new approach is the need to create a new `Step` > record at every decision point. In the end, this may be worth it for the > added design benefits, but would love to be able to get rid of it and find a > solution that gives the added benefits without incurring any performance > penalties. > > Any suggestions anyone can give on improvements would be greatly > appreciated. > > Thanks! > Rich > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Fri Dec 26 10:52:46 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Fri, 26 Dec 2014 10:52:46 +0000 Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: References: Message-ID: <20141226105246.GI31575@weber> On Fri, Dec 26, 2014 at 02:36:07PM +1100, Riaan wrote: > So went back to HDBC. But now my queries are starting to get fairly long > and I have been looking at libraries like Persistent with Esqualeto, > HaskellDB and Groundhog to make my queries a little more composable and > type safe. Don't forget to look at Opaleye too :) It doesn't really have much support for arrays at the moment, but if you let me know what you want to do I'm happy to help you. > So to my question. Does anyone have experience with one of these libraries > in dealing with postgresql arrays postgresql-simple has instance (FromField a, Typeable a) => FromField (PGArray a) Does that not do exactly what you want? Tom From nukasu.kanaka at gmail.com Fri Dec 26 10:56:18 2014 From: nukasu.kanaka at gmail.com (Nikita Volkov) Date: Fri, 26 Dec 2014 13:56:18 +0300 Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <549CFEBA.2030100@amitlevy.com> References: <549CFEBA.2030100@amitlevy.com> Message-ID: There is a new player in this field named Hasql, which provides straightforward mappings to list and vector. On top of that the API is orders of magnitude lighter and the performance is up to 2 and 7 times better compared to "postgresql-simple" and "HDBC". See the results of benchmarks: http://nikita-volkov.github.io/hasql-benchmarks/ Best regards, Nikita 2014-12-26 9:22 GMT+03:00 Amit Aryeh Levy : > I doubt you'd need to extend the built-in conversion functions for > postgresql-simple. In particular there is already an instance fo `ToField` > for: > > `ToField a => ToField (Vector a)` > > meaning there is an instance for the type `Vector (Vector Float)` (because > `Float` is also an instance of `ToField`). I believe that should work out > of the box for you. I've never tried using two dimensional arrays, but I've > used postgresql arrays as Vectors using postgresql-simple a lot, and it > works great out of the box. > > If you're interested in going just a little bit higher level without > abandoning postgresql-simple, I'd suggest postgresql-orm (shameless plug), > which gives you an very lightweight ORM layer on top of postgresql-simple > -- specifically a safe query DSL. > > -Amit > > > On 12/25/2014 07:36 PM, Riaan wrote: > > This is a question about database query libraries. I am trying to do some > analytics on a Postgresql database and up to now have been using > Database.HDBC for most of my querying. > > One of the columns on the database is a two dimensional float8 array. I > tried using Database.PostgreSQL.Simple but got stuck on this array as I > could not figure out how to extend the built in conversion functions to > cater for something like this. So went back to HDBC. But now my queries > are starting to get fairly long and I have been looking at libraries like > Persistent with Esqualeto, HaskellDB and Groundhog to make my queries a > little more composable and type safe. > > However I have not been able to find any examples of any of these > libraries using postgres arrays and given my postgresql-simple experience I > worried that I might similarly be unable, because of my low level of > haskell ability, to extend the conversion functions. > > So to my question. Does anyone have experience with one of these > libraries in dealing with postgresql arrays and could someone perhaps send > me a simple example that I could use as a basis. Failing that, can anyone > advise me on which of these libraries have the most haskell newbie (LYAH > trained, but still struggling with RWH) friendly approach to writing new > conversion functions? > > Thanks > Riaan > > > _______________________________________________ > Haskell-Cafe mailing listHaskell-Cafe at haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Fri Dec 26 11:02:12 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Fri, 26 Dec 2014 11:02:12 +0000 Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141226105246.GI31575@weber> References: <20141226105246.GI31575@weber> Message-ID: <20141226110212.GJ31575@weber> On Fri, Dec 26, 2014 at 10:52:46AM +0000, Tom Ellis wrote: > On Fri, Dec 26, 2014 at 02:36:07PM +1100, Riaan wrote: > > So went back to HDBC. But now my queries are starting to get fairly long > > and I have been looking at libraries like Persistent with Esqualeto, > > HaskellDB and Groundhog to make my queries a little more composable and > > type safe. > > Don't forget to look at Opaleye too :) It doesn't really have much support > for arrays at the moment, but if you let me know what you want to do I'm > happy to help you. > > > So to my question. Does anyone have experience with one of these libraries > > in dealing with postgresql arrays > > postgresql-simple has > > instance (FromField a, Typeable a) => FromField (PGArray a) > > Does that not do exactly what you want? import Database.PostgreSQL.Simple (query_, ConnectInfo(..), connect, Only) import Database.PostgreSQL.Simple.Types (PGArray) import Data.String (fromString) connectInfo :: ConnectInfo connectInfo = ConnectInfo { connectHost = "localhost" , connectPort = 25433 , connectUser = "tom" , connectPassword = "tom" , connectDatabase = "opaleye_test" } arrayQuery :: String arrayQuery = "select '{{1,2}, {3,4}}' :: integer[][]" main :: IO () main = do conn <- connect connectInfo results <- query_ conn (fromString arrayQuery) :: IO [Only (PGArray (PGArray Int))] print results -- Output -- -- ghci> main -- [Only {fromOnly = PGArray {fromPGArray = [PGArray {fromPGArray = [1,2]},PGArray {fromPGArray = [3,4]}]}}] From aslatter at gmail.com Fri Dec 26 15:02:36 2014 From: aslatter at gmail.com (Antoine Latter) Date: Fri, 26 Dec 2014 09:02:36 -0600 Subject: [Haskell-cafe] ghc 7.10.1-rc1 ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format. In-Reply-To: References: Message-ID: I did the following to work around this: I cloned this branch on GitHub: https://github.com/haskell/cabal/tree/1.22 Then, in the cabal-install folder I built the 'cabal-install' binary *without* using the existing version of cabal-install, then used the newly built 'cabal-install' to actually install the new 'cabal-install': cd ghc Setup.hs ./Setup.hs configure ./Seup.hs build dist/build/cabal/cabal install You may need to install some dependencies first - using the old cabal-install worked fine for me for this, but maybe it secretly corrupted something behind the scenes. I haven't had trouble so far. On Fri, Dec 26, 2014 at 2:29 AM, Konstantine Rybnikov wrote: > Hi! > > I just did `sudo make install` on ghc 7.10.1-rc1, removed ~/.ghc and did > `cabal update`. I'm now trying to upgrade to latest cabal by issuing `cabal > install cabal-install`. I get the following: > > ``` > ... > on the commandline: Warning: > -package-name is deprecated: Use -this-package-key instead > ghc: ghc no longer supports single-file style package databases > (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with > the correct format. > Failed to install zlib-0.5.4.2 > cabal: Error: some packages failed to install: > HTTP-3001.0.4 depends on text-1.2.0.3 which failed to install. > cabal-install-0.4.0 depends on zlib-0.5.4.2 which failed to install. > mtl-2.2.1 failed during the building phase. The exception was: > ExitFailure 1 > network-2.6.0.2 failed during the building phase. The exception was: > ExitFailure 1 > parsec-3.1.7 depends on text-1.2.0.3 which failed to install. > text-1.2.0.3 failed during the building phase. The exception was: > ExitFailure 1 > zlib-0.5.4.2 failed during the building phase. The exception was: > ExitFailure 1 > ``` > > Does anyone know a quick-fix? > > Thanks! > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aslatter at gmail.com Fri Dec 26 15:06:14 2014 From: aslatter at gmail.com (Antoine Latter) Date: Fri, 26 Dec 2014 09:06:14 -0600 Subject: [Haskell-cafe] ghc 7.10.1-rc1 ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format. In-Reply-To: References: Message-ID: That should have been: ./Setup configure ./Setup build On Fri, Dec 26, 2014 at 9:02 AM, Antoine Latter wrote: > I did the following to work around this: > > I cloned this branch on GitHub: https://github.com/haskell/cabal/tree/1.22 > > Then, in the cabal-install folder I built the 'cabal-install' binary > *without* using the existing version of cabal-install, then used the newly > built 'cabal-install' to actually install the new 'cabal-install': > > cd > ghc Setup.hs > ./Setup.hs configure > ./Seup.hs build > dist/build/cabal/cabal install > > You may need to install some dependencies first - using the old > cabal-install worked fine for me for this, but maybe it secretly corrupted > something behind the scenes. I haven't had trouble so far. > > On Fri, Dec 26, 2014 at 2:29 AM, Konstantine Rybnikov > wrote: > >> Hi! >> >> I just did `sudo make install` on ghc 7.10.1-rc1, removed ~/.ghc and did >> `cabal update`. I'm now trying to upgrade to latest cabal by issuing `cabal >> install cabal-install`. I get the following: >> >> ``` >> ... >> on the commandline: Warning: >> -package-name is deprecated: Use -this-package-key instead >> ghc: ghc no longer supports single-file style package databases >> (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with >> the correct format. >> Failed to install zlib-0.5.4.2 >> cabal: Error: some packages failed to install: >> HTTP-3001.0.4 depends on text-1.2.0.3 which failed to install. >> cabal-install-0.4.0 depends on zlib-0.5.4.2 which failed to install. >> mtl-2.2.1 failed during the building phase. The exception was: >> ExitFailure 1 >> network-2.6.0.2 failed during the building phase. The exception was: >> ExitFailure 1 >> parsec-3.1.7 depends on text-1.2.0.3 which failed to install. >> text-1.2.0.3 failed during the building phase. The exception was: >> ExitFailure 1 >> zlib-0.5.4.2 failed during the building phase. The exception was: >> ExitFailure 1 >> ``` >> >> Does anyone know a quick-fix? >> >> Thanks! >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at orlitzky.com Fri Dec 26 18:18:24 2014 From: michael at orlitzky.com (Michael Orlitzky) Date: Fri, 26 Dec 2014 13:18:24 -0500 Subject: [Haskell-cafe] Generic "to tuple" function Message-ID: <549DA670.6060905@orlitzky.com> I have tons of code like this: from_tuple = uncurry MLBBoxScoreGameBreakdownXml to_tuple (MLBBoxScoreGameBreakdownXml a h) = (a,h) The first function, from_tuple, generalizes easily with `uncurryN` from Data.Tuple.Curry. But I'm wondering, is there any generic function that will take a simple data type and cram it into a tuple? So instead of writing, from_tuple = uncurryN MLBBoxScoreGameBreakdownTeamXml to_tuple (MLBBoxScoreGameBreakdownTeamXml w x y z) = (w,x,y,z) I could just do, from_tuple = uncurryN MLBBoxScoreGameBreakdownTeamXml to_tuple = toTupleGeneric because things get real ugly when there are ~20 fields in the data type. From roma at ro-che.info Fri Dec 26 22:39:44 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Sat, 27 Dec 2014 00:39:44 +0200 Subject: [Haskell-cafe] Generic "to tuple" function In-Reply-To: <549DA670.6060905@orlitzky.com> References: <549DA670.6060905@orlitzky.com> Message-ID: <549DE3B0.2010908@ro-che.info> On 26/12/14 20:18, Michael Orlitzky wrote: > I have tons of code like this: > > from_tuple = uncurry MLBBoxScoreGameBreakdownXml > to_tuple (MLBBoxScoreGameBreakdownXml a h) = (a,h) > > The first function, from_tuple, generalizes easily with `uncurryN` from > Data.Tuple.Curry. But I'm wondering, is there any generic function that > will take a simple data type and cram it into a tuple? > > So instead of writing, > > from_tuple = uncurryN MLBBoxScoreGameBreakdownTeamXml > to_tuple (MLBBoxScoreGameBreakdownTeamXml w x y z) = (w,x,y,z) > > I could just do, > > from_tuple = uncurryN MLBBoxScoreGameBreakdownTeamXml > to_tuple = toTupleGeneric > > because things get real ugly when there are ~20 fields in the data type. Should be easy to do with the generics-sop package. Roman From k-bx at k-bx.com Sat Dec 27 00:05:37 2014 From: k-bx at k-bx.com (Konstantine Rybnikov) Date: Sat, 27 Dec 2014 02:05:37 +0200 Subject: [Haskell-cafe] ghc 7.10.1-rc1 ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format. In-Reply-To: References: Message-ID: Installing dependencies fails with very same error, unfortunately. On Fri, Dec 26, 2014 at 5:02 PM, Antoine Latter wrote: > I did the following to work around this: > > I cloned this branch on GitHub: https://github.com/haskell/cabal/tree/1.22 > > Then, in the cabal-install folder I built the 'cabal-install' binary > *without* using the existing version of cabal-install, then used the newly > built 'cabal-install' to actually install the new 'cabal-install': > > cd > ghc Setup.hs > ./Setup.hs configure > ./Seup.hs build > dist/build/cabal/cabal install > > You may need to install some dependencies first - using the old > cabal-install worked fine for me for this, but maybe it secretly corrupted > something behind the scenes. I haven't had trouble so far. > > On Fri, Dec 26, 2014 at 2:29 AM, Konstantine Rybnikov > wrote: > >> Hi! >> >> I just did `sudo make install` on ghc 7.10.1-rc1, removed ~/.ghc and did >> `cabal update`. I'm now trying to upgrade to latest cabal by issuing `cabal >> install cabal-install`. I get the following: >> >> ``` >> ... >> on the commandline: Warning: >> -package-name is deprecated: Use -this-package-key instead >> ghc: ghc no longer supports single-file style package databases >> (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with >> the correct format. >> Failed to install zlib-0.5.4.2 >> cabal: Error: some packages failed to install: >> HTTP-3001.0.4 depends on text-1.2.0.3 which failed to install. >> cabal-install-0.4.0 depends on zlib-0.5.4.2 which failed to install. >> mtl-2.2.1 failed during the building phase. The exception was: >> ExitFailure 1 >> network-2.6.0.2 failed during the building phase. The exception was: >> ExitFailure 1 >> parsec-3.1.7 depends on text-1.2.0.3 which failed to install. >> text-1.2.0.3 failed during the building phase. The exception was: >> ExitFailure 1 >> zlib-0.5.4.2 failed during the building phase. The exception was: >> ExitFailure 1 >> ``` >> >> Does anyone know a quick-fix? >> >> Thanks! >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dburke.gw at gmail.com Sat Dec 27 00:09:59 2014 From: dburke.gw at gmail.com (Doug Burke) Date: Fri, 26 Dec 2014 19:09:59 -0500 Subject: [Haskell-cafe] ghc 7.10.1-rc1 ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format. In-Reply-To: References: Message-ID: I ended up installing both Cabal and cabal-install (from GitHub) using ghc 7.8.4. After that things seemed to get better with ghc 7.10 RC1 (which was using my newly created cabal-install command-line tool with the Cabal libs from ghc 7.10). Or at least, I think that's how I got it working. HTH, Doug On Fri, Dec 26, 2014 at 7:05 PM, Konstantine Rybnikov wrote: > Installing dependencies fails with very same error, unfortunately. > > On Fri, Dec 26, 2014 at 5:02 PM, Antoine Latter > wrote: > >> I did the following to work around this: >> >> I cloned this branch on GitHub: >> https://github.com/haskell/cabal/tree/1.22 >> >> Then, in the cabal-install folder I built the 'cabal-install' binary >> *without* using the existing version of cabal-install, then used the newly >> built 'cabal-install' to actually install the new 'cabal-install': >> >> cd >> ghc Setup.hs >> ./Setup.hs configure >> ./Seup.hs build >> dist/build/cabal/cabal install >> >> You may need to install some dependencies first - using the old >> cabal-install worked fine for me for this, but maybe it secretly corrupted >> something behind the scenes. I haven't had trouble so far. >> >> On Fri, Dec 26, 2014 at 2:29 AM, Konstantine Rybnikov >> wrote: >> >>> Hi! >>> >>> I just did `sudo make install` on ghc 7.10.1-rc1, removed ~/.ghc and did >>> `cabal update`. I'm now trying to upgrade to latest cabal by issuing `cabal >>> install cabal-install`. I get the following: >>> >>> ``` >>> ... >>> on the commandline: Warning: >>> -package-name is deprecated: Use -this-package-key instead >>> ghc: ghc no longer supports single-file style package databases >>> (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with >>> the correct format. >>> Failed to install zlib-0.5.4.2 >>> cabal: Error: some packages failed to install: >>> HTTP-3001.0.4 depends on text-1.2.0.3 which failed to install. >>> cabal-install-0.4.0 depends on zlib-0.5.4.2 which failed to install. >>> mtl-2.2.1 failed during the building phase. The exception was: >>> ExitFailure 1 >>> network-2.6.0.2 failed during the building phase. The exception was: >>> ExitFailure 1 >>> parsec-3.1.7 depends on text-1.2.0.3 which failed to install. >>> text-1.2.0.3 failed during the building phase. The exception was: >>> ExitFailure 1 >>> zlib-0.5.4.2 failed during the building phase. The exception was: >>> ExitFailure 1 >>> ``` >>> >>> Does anyone know a quick-fix? >>> >>> Thanks! >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lykahb at gmail.com Sat Dec 27 00:48:13 2014 From: lykahb at gmail.com (Boris Lykah) Date: Fri, 26 Dec 2014 19:48:13 -0500 Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141226110212.GJ31575@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> Message-ID: Groundhog has support for PostgreSQL arrays and almost all operations on them. Check out the docs at http://hackage.haskell.org/package/groundhog-postgresql/docs/Database-Groundhog-Postgresql-Array.html Here is a tutorial for the library https://www.fpcomplete.com/user/lykahb/groundhog The array code looks like main = withPostgresqlConn connectionString . runDbConn $ do key <- insert $ MyData $ Array [1, 2, 3] results <- select $ arrayLength MyField 1 <. (5 :: Int) -- length of array dimension 1 is less than 5 liftIO $ print results On Fri, Dec 26, 2014 at 6:02 AM, Tom Ellis < tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote: > On Fri, Dec 26, 2014 at 10:52:46AM +0000, Tom Ellis wrote: > > On Fri, Dec 26, 2014 at 02:36:07PM +1100, Riaan wrote: > > > So went back to HDBC. But now my queries are starting to get fairly > long > > > and I have been looking at libraries like Persistent with Esqualeto, > > > HaskellDB and Groundhog to make my queries a little more composable and > > > type safe. > > > > Don't forget to look at Opaleye too :) It doesn't really have much > support > > for arrays at the moment, but if you let me know what you want to do I'm > > happy to help you. > > > > > So to my question. Does anyone have experience with one of these > libraries > > > in dealing with postgresql arrays > > > > postgresql-simple has > > > > instance (FromField a, Typeable a) => FromField (PGArray a) > > > > Does that not do exactly what you want? > > import Database.PostgreSQL.Simple (query_, ConnectInfo(..), connect, Only) > import Database.PostgreSQL.Simple.Types (PGArray) > > import Data.String (fromString) > > connectInfo :: ConnectInfo > connectInfo = ConnectInfo { connectHost = "localhost" > , connectPort = 25433 > , connectUser = "tom" > , connectPassword = "tom" > , connectDatabase = "opaleye_test" } > > arrayQuery :: String > arrayQuery = "select '{{1,2}, {3,4}}' :: integer[][]" > > main :: IO () > main = do > conn <- connect connectInfo > results <- query_ conn (fromString arrayQuery) :: IO [Only (PGArray > (PGArray Int))] > print results > > -- Output > -- > -- ghci> main > -- [Only {fromOnly = PGArray {fromPGArray = [PGArray {fromPGArray = > [1,2]},PGArray {fromPGArray = [3,4]}]}}] > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Regards, Boris -------------- next part -------------- An HTML attachment was scrubbed... URL: From vogt.adam at gmail.com Sat Dec 27 03:58:05 2014 From: vogt.adam at gmail.com (adam vogt) Date: Fri, 26 Dec 2014 22:58:05 -0500 Subject: [Haskell-cafe] Generic "to tuple" function In-Reply-To: <549DE3B0.2010908@ro-che.info> References: <549DA670.6060905@orlitzky.com> <549DE3B0.2010908@ro-che.info> Message-ID: On Fri, Dec 26, 2014 at 5:39 PM, Roman Cheplyaka wrote: > On 26/12/14 20:18, Michael Orlitzky wrote: >> I could just do, >> >> from_tuple = uncurryN MLBBoxScoreGameBreakdownTeamXml >> to_tuple = toTupleGeneric >> >> because things get real ugly when there are ~20 fields in the data type. > > Should be easy to do with the generics-sop package. > > Roman http://lpaste.net/117317 works using the older Data.Data.Data, but it's dissatisfying because if you get the result type wrong (too few or too many elements), you'll always get a Nothing. Maybe generics-sop is better in that respect. Regards, Adam From rwallace at thewallacepack.net Sat Dec 27 04:16:33 2014 From: rwallace at thewallacepack.net (Richard Wallace) Date: Fri, 26 Dec 2014 21:16:33 -0700 Subject: [Haskell-cafe] Encoding for flow charts In-Reply-To: References: Message-ID: Thanks for the reply. That is an interesting alternative I hadn't considered. What I end up with applying it to flow charts is something like the following data FlowChart m a where Decision :: m Bool -> FlowChart m a -> FlowChart m a -> FlowChart m a Done :: m a -> FlowChart m a runFlowChart :: FlowChart m a -> m a runFlowChart (Decision cond falsePath truePath) = cond >>= \c -> runFlowChart (if c truePath else falsePath) runFlowChart (Done a) = a s0 = Decision testS0 s1 s2 s1 = Done s1Result s2 = Done s2Result This is simpler than what I was trying to do. It should have all the same benefits as well. I'm going to give this a spin and see how it goes. Thanks! On Fri, Dec 26, 2014 at 1:39 AM, Stephen Tetley wrote: > Hi Richard > > It might be worth looking at Wyatt Allan and Martin Erwig's Surveyor > DSEL for alternative design ideas. The authors directly encode > questions rather than states which, without looking closely, seems > more natural to me - I think you could envisage flow diagrams as > specializations of "surveys". > > The paper is available from Martin's website: > > http://web.engr.oregonstate.edu/~erwig/papers/abstracts.html > > Best wishes > > Stephen > > On 25 December 2014 at 23:34, Richard Wallace > wrote: > > Hello, > > > > I've been working to encode a fairly complex flow chart. At first I took > the > > simple approach of having a single data type for the possible states > > > > data S = S0 | S1 | S2 > > > > and then a simple recursive function to step through it > > > > loop :: Monad m => S -> StateT s m Result > > loop S0 = testS0 >>= \r -> if r then loop S1 else loop S2 > > loop S1 = s1Result > > loop S2 = s2Result > > > > This works well enough, but with the size of the flow chart I'm working > with > > (50+ decision points) it quickly becomes clear that it's probably not the > > most best way to do it. One problem that I'd like to solve is being > able to > > test each decision point in isolation, making sure that decision point > `m` > > will go to decision point `n` when it is supposed to, without having to > run > > through the whole rest of the flow chart that would otherwise follow. > > Something else I'd like to achieve is being able to organize the > decisions > > into separate modules - much better than having just the one big function > > above. > > > > Here's what I've come up with as an alternative so far. > > > > data Step a b where > > TrueFlow :: Decision a d e => a -> Step a b > > FalseFlow :: Decision b f g => b -> Step a b > > Done :: Result -> Step a b > > > > class Decision a b c | a -> b, a -> c where > > decide :: (Functor m, Monad m) => a -> StateT s m (Step b c) > > > > data S0 = S0 deriving (Show, Eq) > > instance Decision S0 S1 S2 where > > decide _ = bool (FalseFlow S2) (TrueFlow S1) <$> testS0 > > > > data S1 = S1 deriving (Show, Eq) > > instance Decision S1 () () where > > decide _ = s1Result > > > > data S2 = S2 deriving (Show, Eq) > > instance Decision S2 () () where > > decide _ = s2Result > > > > decision :: (Functor m, Monad m, Decision a b c) > > => a > > -> StateT s m Result > > decision s = decide s >>= \case > > TrueFlow b -> decision b > > FalseFlow c -> decision c > > Done s -> return s > > > > With this implementation it is easy to test a single decision point, - > just > > use `evalStateT (decide S0) s` and compare the resulting Step to make > sure > > it is either S1 or S2. The logic can also be easily separated and > organized > > into modules. > > > > The biggest drawback of this new approach is the need to create a new > `Step` > > record at every decision point. In the end, this may be worth it for the > > added design benefits, but would love to be able to get rid of it and > find a > > solution that gives the added benefits without incurring any performance > > penalties. > > > > Any suggestions anyone can give on improvements would be greatly > > appreciated. > > > > Thanks! > > Rich > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sat Dec 27 04:17:56 2014 From: info at rotnetix.com (Riaan) Date: Sat, 27 Dec 2014 15:17:56 +1100 Subject: [Haskell-cafe] Handling Postgresql array types Message-ID: Thank you very much. I have actually started to have a look at opaleye independently after the reddit discussion and I would like to experiment with it. I assume that I somehow have to declare my own queryRunnerColumn for the array. I am afraid that I did not understand the example so I was not able to generalise it. Date: Fri, 26 Dec 2014 11:02:12 +0000 From: Tom Ellis To: haskell-cafe at haskell.org Subject: Re: [Haskell-cafe] Handling Postgresql array types Message-ID: <20141226110212.GJ31575 at weber> Content-Type: text/plain; charset=us-ascii On Fri, Dec 26, 2014 at 10:52:46AM +0000, Tom Ellis wrote: > On Fri, Dec 26, 2014 at 02:36:07PM +1100, Riaan wrote: > > So went back to HDBC. But now my queries are starting to get fairly long > > and I have been looking at libraries like Persistent with Esqualeto, > > HaskellDB and Groundhog to make my queries a little more composable and > > type safe. > > Don't forget to look at Opaleye too :) It doesn't really have much support > for arrays at the moment, but if you let me know what you want to do I'm > happy to help you. > > > So to my question. Does anyone have experience with one of these libraries > > in dealing with postgresql arrays > > postgresql-simple has > > instance (FromField a, Typeable a) => FromField (PGArray a) > > Does that not do exactly what you want? import Database.PostgreSQL.Simple (query_, ConnectInfo(..), connect, Only) import Database.PostgreSQL.Simple.Types (PGArray) import Data.String (fromString) connectInfo :: ConnectInfo connectInfo = ConnectInfo { connectHost = "localhost" , connectPort = 25433 , connectUser = "tom" , connectPassword = "tom" , connectDatabase = "opaleye_test" } arrayQuery :: String arrayQuery = "select '{{1,2}, {3,4}}' :: integer[][]" main :: IO () main = do conn <- connect connectInfo results <- query_ conn (fromString arrayQuery) :: IO [Only (PGArray (PGArray Int))] print results -- Output -- -- ghci> main -- [Only {fromOnly = PGArray {fromPGArray = [PGArray {fromPGArray = [1,2]},PGArray {fromPGArray = [3,4]}]}}] -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sat Dec 27 05:31:02 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Fri, 26 Dec 2014 21:31:02 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141226110212.GJ31575@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> Message-ID: <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> Thank you for pointing me in the right way. This does almost what I want. However I want to end up with a [[Double]] rather than (PGArray (PGArray Double)). I know I can do the conversion using fromPGArray but I was hoping to use the fromRow instances to remove some of the boilerplate. So I have: data IIM = IIM {key :: String ,itype :: String ,idet :: Maybe String ,imat :: (PGArray (PGArray Double))} deriving (Read, Show, Eq) instance FromRow IIM where fromRow = IIM <$> field <*> field <*> field <*> field Which works fine, but I would actually like my data IIM to be: data IIM = IIM {key :: String ,itype :: String ,idet :: Maybe String ,imat :: [[Double]]} deriving (Read, Show, Eq) But I can't figure out how to get a fromRow instance for that, otherwise I need to return SQL results in a (,,,,) and then create the IIM from that which seems a lot of extra typing. PS. I started looking into Opaleye as a possible DSL and would appreciate any help you can give me in figuring out how to represent arrays in that. I am assuming I need to do something with queryRunnerColumn but I was not able to understand the example. On Friday, December 26, 2014 10:02:21 PM UTC+11, Tom Ellis wrote: > > On Fri, Dec 26, 2014 at 10:52:46AM +0000, Tom Ellis wrote: > > On Fri, Dec 26, 2014 at 02:36:07PM +1100, Riaan wrote: > > > So went back to HDBC. But now my queries are starting to get fairly > long > > > and I have been looking at libraries like Persistent with Esqualeto, > > > HaskellDB and Groundhog to make my queries a little more composable > and > > > type safe. > > > > Don't forget to look at Opaleye too :) It doesn't really have much > support > > for arrays at the moment, but if you let me know what you want to do I'm > > happy to help you. > > > > > So to my question. Does anyone have experience with one of these > libraries > > > in dealing with postgresql arrays > > > > postgresql-simple has > > > > instance (FromField a, Typeable a) => FromField (PGArray a) > > > > Does that not do exactly what you want? > > import Database.PostgreSQL.Simple (query_, ConnectInfo(..), connect, Only) > import Database.PostgreSQL.Simple.Types (PGArray) > > import Data.String (fromString) > > connectInfo :: ConnectInfo > connectInfo = ConnectInfo { connectHost = "localhost" > , connectPort = 25433 > , connectUser = "tom" > , connectPassword = "tom" > , connectDatabase = "opaleye_test" } > > arrayQuery :: String > arrayQuery = "select '{{1,2}, {3,4}}' :: integer[][]" > > main :: IO () > main = do > conn <- connect connectInfo > results <- query_ conn (fromString arrayQuery) :: IO [Only (PGArray > (PGArray Int))] > print results > > -- Output > -- > -- ghci> main > -- [Only {fromOnly = PGArray {fromPGArray = [PGArray {fromPGArray = > [1,2]},PGArray {fromPGArray = [3,4]}]}}] > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sat Dec 27 05:31:02 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Fri, 26 Dec 2014 21:31:02 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141226110212.GJ31575@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> Message-ID: <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> Thank you for pointing me in the right way. This does almost what I want. However I want to end up with a [[Double]] rather than (PGArray (PGArray Double)). I know I can do the conversion using fromPGArray but I was hoping to use the fromRow instances to remove some of the boilerplate. So I have: data IIM = IIM {key :: String ,itype :: String ,idet :: Maybe String ,imat :: (PGArray (PGArray Double))} deriving (Read, Show, Eq) instance FromRow IIM where fromRow = IIM <$> field <*> field <*> field <*> field Which works fine, but I would actually like my data IIM to be: data IIM = IIM {key :: String ,itype :: String ,idet :: Maybe String ,imat :: [[Double]]} deriving (Read, Show, Eq) But I can't figure out how to get a fromRow instance for that, otherwise I need to return SQL results in a (,,,,) and then create the IIM from that which seems a lot of extra typing. PS. I started looking into Opaleye as a possible DSL and would appreciate any help you can give me in figuring out how to represent arrays in that. I am assuming I need to do something with queryRunnerColumn but I was not able to understand the example. On Friday, December 26, 2014 10:02:21 PM UTC+11, Tom Ellis wrote: > > On Fri, Dec 26, 2014 at 10:52:46AM +0000, Tom Ellis wrote: > > On Fri, Dec 26, 2014 at 02:36:07PM +1100, Riaan wrote: > > > So went back to HDBC. But now my queries are starting to get fairly > long > > > and I have been looking at libraries like Persistent with Esqualeto, > > > HaskellDB and Groundhog to make my queries a little more composable > and > > > type safe. > > > > Don't forget to look at Opaleye too :) It doesn't really have much > support > > for arrays at the moment, but if you let me know what you want to do I'm > > happy to help you. > > > > > So to my question. Does anyone have experience with one of these > libraries > > > in dealing with postgresql arrays > > > > postgresql-simple has > > > > instance (FromField a, Typeable a) => FromField (PGArray a) > > > > Does that not do exactly what you want? > > import Database.PostgreSQL.Simple (query_, ConnectInfo(..), connect, Only) > import Database.PostgreSQL.Simple.Types (PGArray) > > import Data.String (fromString) > > connectInfo :: ConnectInfo > connectInfo = ConnectInfo { connectHost = "localhost" > , connectPort = 25433 > , connectUser = "tom" > , connectPassword = "tom" > , connectDatabase = "opaleye_test" } > > arrayQuery :: String > arrayQuery = "select '{{1,2}, {3,4}}' :: integer[][]" > > main :: IO () > main = do > conn <- connect connectInfo > results <- query_ conn (fromString arrayQuery) :: IO [Only (PGArray > (PGArray Int))] > print results > > -- Output > -- > -- ghci> main > -- [Only {fromOnly = PGArray {fromPGArray = [PGArray {fromPGArray = > [1,2]},PGArray {fromPGArray = [3,4]}]}}] > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sat Dec 27 05:43:48 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Fri, 26 Dec 2014 21:43:48 -0800 (PST) Subject: [Haskell-cafe] ANN: Groundhog-inspector, a tool for generating datatypes from database In-Reply-To: References: Message-ID: <7152ea95-e861-4514-9732-5356bfb7832e@googlegroups.com> Looks like a great idea. I tried it on one of my databases and got the following error: ** Exception: mkUniqueKeyPhantomName: (Just "public","itrd_test")uniques list must be not empty Do you know what that might mean? On Friday, December 5, 2014 4:07:34 AM UTC+11, Boris Lykah wrote: > > Hello everyone, > > I am pleased to announce groundhog-inspector. It analyzes database schema > and creates corresponding datatypes and mapping configuration for > Groundhog. It works with PostgreSQL, MySQL, and Sqlite. Composite keys, > constraints, references across schemas, and other details of schema are > reflected in the output. Groundhog-inspector can be used as a library and > provides a standalone tool for simple scenarios. > > Here is an example of the standalone tool usage. JSON mapping in the > output was manually converted to YAML for brevity. > > $ sqlite3 dbfile "CREATE TABLE mytable (id INTEGER PRIMARY KEY NOT NULL, > str VARCHAR NOT NULL, ref INTEGER references mytable)" > > $ groundhog_inspector sqlite dbfile > > data Mytable > = Mytable {mytableStr :: String, > mytableRef :: (Maybe (AutoKey Mytable))} > > - entity: "Mytable" > dbName: "mytable" > constructors: > - name: "Mytable" > fields: > - name: "mytableStr" > dbName: "str" > - name: "mytableRef" > dbName: "ref" > > * [Hackage] (http://hackage.haskell.org/package/groundhog-inspector) > * [GitHub] ( > https://github.com/lykahb/groundhog/tree/master/groundhog-inspector/examples > ) > > I would be happy to answer the questions. Enjoy! > > Regards, > Boris Lykah > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sat Dec 27 05:43:48 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Fri, 26 Dec 2014 21:43:48 -0800 (PST) Subject: [Haskell-cafe] ANN: Groundhog-inspector, a tool for generating datatypes from database In-Reply-To: References: Message-ID: <7152ea95-e861-4514-9732-5356bfb7832e@googlegroups.com> Looks like a great idea. I tried it on one of my databases and got the following error: ** Exception: mkUniqueKeyPhantomName: (Just "public","itrd_test")uniques list must be not empty Do you know what that might mean? On Friday, December 5, 2014 4:07:34 AM UTC+11, Boris Lykah wrote: > > Hello everyone, > > I am pleased to announce groundhog-inspector. It analyzes database schema > and creates corresponding datatypes and mapping configuration for > Groundhog. It works with PostgreSQL, MySQL, and Sqlite. Composite keys, > constraints, references across schemas, and other details of schema are > reflected in the output. Groundhog-inspector can be used as a library and > provides a standalone tool for simple scenarios. > > Here is an example of the standalone tool usage. JSON mapping in the > output was manually converted to YAML for brevity. > > $ sqlite3 dbfile "CREATE TABLE mytable (id INTEGER PRIMARY KEY NOT NULL, > str VARCHAR NOT NULL, ref INTEGER references mytable)" > > $ groundhog_inspector sqlite dbfile > > data Mytable > = Mytable {mytableStr :: String, > mytableRef :: (Maybe (AutoKey Mytable))} > > - entity: "Mytable" > dbName: "mytable" > constructors: > - name: "Mytable" > fields: > - name: "mytableStr" > dbName: "str" > - name: "mytableRef" > dbName: "ref" > > * [Hackage] (http://hackage.haskell.org/package/groundhog-inspector) > * [GitHub] ( > https://github.com/lykahb/groundhog/tree/master/groundhog-inspector/examples > ) > > I would be happy to answer the questions. Enjoy! > > Regards, > Boris Lykah > -------------- next part -------------- An HTML attachment was scrubbed... URL: From codygman.consulting at gmail.com Sat Dec 27 10:13:33 2014 From: codygman.consulting at gmail.com (Cody Goodman) Date: Sat, 27 Dec 2014 04:13:33 -0600 Subject: [Haskell-cafe] compile ghc on Nexus 7 Android Tablet Message-ID: How would I go about this? I see a lot of stuff about compiling for android/arm, but not too much about putting ghc on an android arm tablet. Has anyone done this? I'm sure it's easier with ubuntu touch, but I'd like to try it using vanilla android. Thanks! From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Sat Dec 27 11:23:36 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Sat, 27 Dec 2014 11:23:36 +0000 Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> Message-ID: <20141227112336.GN31575@weber> On Fri, Dec 26, 2014 at 09:31:02PM -0800, info at rotnetix.com wrote: > I would actually like my data IIM to be: > > data IIM = IIM {key :: String > ,itype :: String > ,idet :: Maybe String > ,imat :: [[Double]]} deriving (Read, Show, Eq) > > But I can't figure out how to get a fromRow instance for that instance FromRow IIM where fromRow = IIM <$> field <*> field <*> field <*> fmap (T.fromPGArray . fmap T.fromPGArray) field > PS. I started looking into Opaleye as a possible DSL and would appreciate > any help you can give me in figuring out how to represent arrays in that. > I am assuming I need to do something with queryRunnerColumn but I was not > able to understand the example. This is indeed somewhat fiddly to do because it requires fiddling with the implementation of postgresql-simple instances. Unfortunately that library does not provide us with enough primitives to do this directly. I will work on this. Tom From serg.foo at gmail.com Sat Dec 27 12:00:09 2014 From: serg.foo at gmail.com (Sergey Vinokurov) Date: Sat, 27 Dec 2014 14:00:09 +0200 Subject: [Haskell-cafe] compile ghc on Nexus 7 Android Tablet In-Reply-To: References: Message-ID: Hi, perhaps the best strategy that comes to my mind would be to build ghc cross-compiler first as outlined in https://github.com/joeyh/ghc-android. And then try to build ghc STAGE1 compiler and libraries with this crosscompiler so they'll run on arm. The problem though is that ghc has no native arm backend IIRC. So you'll have to either build unregistered compiler to run on arm that will compile through C or make arm ghc compile with LLVM, in which case you'll also need LLVM binaries for android. Sergey On Sat, Dec 27, 2014 at 12:13 PM, Cody Goodman wrote: > How would I go about this? I see a lot of stuff about compiling for > android/arm, but not too much about putting ghc on an android arm > tablet. Has anyone done this? I'm sure it's easier with ubuntu touch, > but I'd like to try it using vanilla android. > > Thanks! > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Sat Dec 27 12:09:46 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Sat, 27 Dec 2014 12:09:46 +0000 Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141227112336.GN31575@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> Message-ID: <20141227120946.GO31575@weber> On Sat, Dec 27, 2014 at 11:23:36AM +0000, Tom Ellis wrote: > > PS. I started looking into Opaleye as a possible DSL and would appreciate > > any help you can give me in figuring out how to represent arrays in that. > > I am assuming I need to do something with queryRunnerColumn but I was not > > able to understand the example. > > This is indeed somewhat fiddly to do because it requires fiddling with the > implementation of postgresql-simple instances. Unfortunately that library > does not provide us with enough primitives to do this directly. OK, I just pushed a patch to GitHub https://github.com/tomjaguarpaw/haskell-opaleye Now you can do the below. You can't actually do anything with your arrays yet except just read them from tables and return them from `runQuery` but let me know what functionality you want and I will endevour to support it. import Database.PostgreSQL.Simple (execute_, ConnectInfo(..), connect) import Data.String (fromString) import Opaleye connectInfo :: ConnectInfo connectInfo = ConnectInfo { connectHost = "localhost" , connectPort = 25433 , connectUser = "tom" , connectPassword = "tom" , connectDatabase = "opaleye_test" } table :: Table (Column (PGArray (PGArray PGInt4))) (Column (PGArray (PGArray PGInt4))) table = Table "arraytable" (required "colname") query :: Query (Column (PGArray (PGArray PGInt4))) query = queryTable table main :: IO () main = do conn <- connect connectInfo let q = execute_ conn . fromString q "DROP TABLE IF EXISTS arraytable" q "CREATE TABLE arraytable (colname integer[][])" q "INSERT INTO arraytable VALUES ('{{1,2}, {3,4}}'), ('{{5,6}, {7,8}}')" results' <- runQuery conn query :: IO [[[Int]]] print results' -- ghci> main -- [[[1,2],[3,4]],[[5,6],[7,8]]] From hjgtuyl at chello.nl Sat Dec 27 14:39:50 2014 From: hjgtuyl at chello.nl (Henk-Jan van Tuyl) Date: Sat, 27 Dec 2014 15:39:50 +0100 Subject: [Haskell-cafe] Computer Language Benchmarks Game: Mandelbrot Message-ID: L.S., The holidays a good time to do something about the Haskell entries for the Computer Language Benchmarks Game. I made the Mandelbrot entry[0] a bit smaller, see the attached file. I removed superfluous imports, type declarations and all bangs (except in the line "data T = T !Int !Int !Int !Double"). Both with and without bangs, there is a memory leak; in both cases, the run time is the same (tested on Windows 8.1, GHC 7.8.3). If no one knows any further improvements, I will submit my version to the Benchmarks Game. By the way, would it be a good idea to create a public (Darcs) repository for the Benchmarks Game entries? Regards, Henk-Jan van Tuyl [0] http://benchmarksgame.alioth.debian.org/u64q/program.php?test=mandelbrot&lang=ghc&id=2 -- Folding at home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming -------------- next part -------------- A non-text attachment was scrubbed... Name: Mandelbrot.hs Type: application/octet-stream Size: 3012 bytes Desc: not available URL: From michael at orlitzky.com Sat Dec 27 15:45:13 2014 From: michael at orlitzky.com (Michael Orlitzky) Date: Sat, 27 Dec 2014 10:45:13 -0500 Subject: [Haskell-cafe] Generic "to tuple" function In-Reply-To: <549DE3B0.2010908@ro-che.info> References: <549DA670.6060905@orlitzky.com> <549DE3B0.2010908@ro-che.info> Message-ID: <549ED409.2070408@orlitzky.com> On 12/26/2014 05:39 PM, Roman Cheplyaka wrote: > On 26/12/14 20:18, Michael Orlitzky wrote: >> >> But I'm wondering, is there any generic function that >> will take a simple data type and cram it into a tuple? > > Should be easy to do with the generics-sop package. > Thanks, I was able to get this working in ghci: import qualified GHC.Generics as GHC import Generics.SOP data Foo = Bar Int Int Int Int deriving (Show, GHC.Generic) instance Generic Foo to_tuple :: Foo -> (Int, Int, Int, Int) to_tuple (Bar w x y z) = (w,x,y,z) toTupleG = to . from An example: > let b = Bar 1 2 3 4 > to_tuple b (1,2,3,4) > toTupleG b :: (Int,Int,Int,Int) (1,2,3,4) From lykahb at gmail.com Sat Dec 27 15:49:23 2014 From: lykahb at gmail.com (Boris Lykah) Date: Sat, 27 Dec 2014 10:49:23 -0500 Subject: [Haskell-cafe] ANN: Groundhog-inspector, a tool for generating datatypes from database In-Reply-To: <7152ea95-e861-4514-9732-5356bfb7832e@googlegroups.com> References: <7152ea95-e861-4514-9732-5356bfb7832e@googlegroups.com> Message-ID: Thanks for the report. Can you please send the SQL definition of public.itrd_test? Looking at the code I think that it might have indexes with expressions. On Sat, Dec 27, 2014 at 12:43 AM, wrote: > Looks like a great idea. I tried it on one of my databases and got the > following error: > > ** Exception: mkUniqueKeyPhantomName: (Just "public","itrd_test")uniques > list must be not empty > > Do you know what that might mean? > > On Friday, December 5, 2014 4:07:34 AM UTC+11, Boris Lykah wrote: >> >> Hello everyone, >> >> I am pleased to announce groundhog-inspector. It analyzes database schema >> and creates corresponding datatypes and mapping configuration for >> Groundhog. It works with PostgreSQL, MySQL, and Sqlite. Composite keys, >> constraints, references across schemas, and other details of schema are >> reflected in the output. Groundhog-inspector can be used as a library and >> provides a standalone tool for simple scenarios. >> >> Here is an example of the standalone tool usage. JSON mapping in the >> output was manually converted to YAML for brevity. >> >> $ sqlite3 dbfile "CREATE TABLE mytable (id INTEGER PRIMARY KEY NOT NULL, >> str VARCHAR NOT NULL, ref INTEGER references mytable)" >> >> $ groundhog_inspector sqlite dbfile >> >> data Mytable >> = Mytable {mytableStr :: String, >> mytableRef :: (Maybe (AutoKey Mytable))} >> >> - entity: "Mytable" >> dbName: "mytable" >> constructors: >> - name: "Mytable" >> fields: >> - name: "mytableStr" >> dbName: "str" >> - name: "mytableRef" >> dbName: "ref" >> >> * [Hackage] (http://hackage.haskell.org/package/groundhog-inspector) >> * [GitHub] (https://github.com/lykahb/groundhog/tree/master/ >> groundhog-inspector/examples) >> >> I would be happy to answer the questions. Enjoy! >> >> Regards, >> Boris Lykah >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Regards, Boris -------------- next part -------------- An HTML attachment was scrubbed... URL: From gonzaw308 at gmail.com Sat Dec 27 18:31:40 2014 From: gonzaw308 at gmail.com (gonzaw) Date: Sat, 27 Dec 2014 11:31:40 -0700 (MST) Subject: [Haskell-cafe] Tutorials on Machines? Message-ID: <1419705100212-5762883.post@n5.nabble.com> Hi. I've been recently getting into the streaming libraries (pipes, conduit, etc), and noticed there was this talk about this "Machines" library which supposedly handles streaming too. However, I'm getting a little confused after reading its source. From what it seems, machines are a completely different beast than pipes or conduits, and I don't seem to find good guides on what exactly they are, other than a generic "a machine is a thingy that takes inputs and maybe produces some output or something". Pipes and conduits I see as constructions that only allow streaming. You put this construction in "between" a source of inputs and a consumer of outputs, and it streams from one to the other, possibly with side-effects, state, termination, etc. The thing is that the tutorials on them, and the examples that get used to show their power, make sense in this context, so you can easily grok them. But it's harder to grok Machines. I see the source and notice how you can model Moore machines, Mealy machines, Stacks, and other constructions, and all of this can be made into machines. But at the same time you can construct machines by yourself with Plans, using similar syntax used by pipes/conduit ("yield", "await"). So it confuses me, since I'm not sure what the connection between concepts like Mealy machines, and concepts like "yield"/"await" (which are also used in other streaming libraries), is. I'd like to know if there is a good tutorial on what all of these are, how they relate to each other, and allow you to easily understand all those constructions (moore/mealy machines, plans, processes, etc) and understand when you can use one or the other. Thanks. -- View this message in context: http://haskell.1045720.n5.nabble.com/Tutorials-on-Machines-tp5762883.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. From bneijt at gmail.com Sat Dec 27 20:23:12 2014 From: bneijt at gmail.com (Bram Neijt) Date: Sat, 27 Dec 2014 21:23:12 +0100 Subject: [Haskell-cafe] FRP Tutorial In-Reply-To: References: <20141224125710.7c9157d4@veeloqu.lan> Message-ID: I'm trying to wrap my head around FRP by ignoring the whole GUI part for now and working with Sodium[6] to do simple really simple things[1]. I've extracted the Poodle (OpenGL with Sodium) example into a separate github to add a cabal file[2]. You should be able to use 'cabal run' on that. Top FRP talk on Youtube I have found thus far is: An Event-driven and Reactive Future[3], which does a nice overview of FRP and how it relates to other patterns. Also playing around with Elm[4] and Bacon.js[5] in the browser is fun. If you find working GUI examples, please consider sharing them and posting a link on this thread! Greetings, Bram [1] http://bneijt.nl/blog/post/sodium-frp-simplest-example [2] https://github.com/bneijt/poodle [3] https://www.youtube.com/watch?v=_VdIQTtRkb8 [4] http://elm-lang.org/ [5] https://baconjs.github.io/ [6] https://hackage.haskell.org/package/sodium On Wed, Dec 24, 2014 at 2:33 PM, Heinrich Apfelmus wrote: > Max Voit wrote: >> >> Heinrich Apfelmus wrote: >> >>> As for reactive-banana-wx: There's a reason I started Threepenny. :) >> >> >> Regarding this issue: Could you please clarify this (ideally on the >> threepenny and reactive-banana github pages)? I have looked into these >> projects from time to time and was quite confused by all the dependency >> changes (threepenny being now standalone without relation to >> reactive-banana, if i understood correctly). I guess a clear note would >> be helpful to a lot of people looking for a FRP library. > > > Well, there are FRP (functional reactive programming) libraries and there > are GUI (graphical user interface) libraries. While the two go well > together, these are really two separate concepts. Which one of the two are > you looking for? > > reactive-banana = FRP only > reactive-banana-wx = connects a GUI library and an FRP library > threepenny = mainly GUI, but includes a small FRP part > > I will try to make the distinction more clear on the project homepage (to > which the github pages link), but I can't guarantee that there will be less > confusion for people who are completely new to these ideas. > > > Best regards, > Heinrich Apfelmus > > -- > http://apfelmus.nfshost.com > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From haskell at ibotty.net Sat Dec 27 20:38:47 2014 From: haskell at ibotty.net (Tobias Florek) Date: Sat, 27 Dec 2014 21:38:47 +0100 Subject: [Haskell-cafe] Tutorials on Machines? In-Reply-To: <1419705100212-5762883.post@n5.nabble.com> References: <1419705100212-5762883.post@n5.nabble.com> Message-ID: <20141227203847.15620.27150@x201> Hi, there is a tutorial written by Paul Wilson [1]. Unfortunately it does not go into the hairy stuff (leftovers, error handling, etc.) but it's a nice introduction. [1]: http://statusfailed.com/blog/2014/09/02/practical-machines-in-60-seconds.html Have fun, Tobias Florek From codygman.consulting at gmail.com Sat Dec 27 21:47:04 2014 From: codygman.consulting at gmail.com (Cody Goodman) Date: Sat, 27 Dec 2014 15:47:04 -0600 Subject: [Haskell-cafe] compile ghc on Nexus 7 Android Tablet In-Reply-To: References: Message-ID: Thank you for your help Sergey. On Sat, Dec 27, 2014 at 6:00 AM, Sergey Vinokurov wrote: > Hi, perhaps the best strategy that comes to my mind would be to build ghc > cross-compiler first as outlined in https://github.com/joeyh/ghc-android. > And then try to build ghc STAGE1 compiler and libraries with this crosscompiler > so they'll run on arm. > > The problem though is that ghc has no native arm backend IIRC. So you'll have to > either build unregistered compiler to run on arm that will compile through C or > make arm ghc compile with LLVM, in which case you'll also need LLVM > binaries for android. > > Sergey > > On Sat, Dec 27, 2014 at 12:13 PM, Cody Goodman > wrote: >> How would I go about this? I see a lot of stuff about compiling for >> android/arm, but not too much about putting ghc on an android arm >> tablet. Has anyone done this? I'm sure it's easier with ubuntu touch, >> but I'd like to try it using vanilla android. >> >> Thanks! >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe From k-bx at k-bx.com Sat Dec 27 23:23:27 2014 From: k-bx at k-bx.com (Konstantine Rybnikov) Date: Sun, 28 Dec 2014 01:23:27 +0200 Subject: [Haskell-cafe] ghc 7.10.1-rc1 ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format. In-Reply-To: References: Message-ID: Yes, it seems installing latest cabal under ghc 7.8 first and upgrading to 7.10 afterwards is the way to go. Thanks! On Sat, Dec 27, 2014 at 2:09 AM, Doug Burke wrote: > > I ended up installing both Cabal and cabal-install (from GitHub) using ghc > 7.8.4. After that things seemed to get better with ghc 7.10 RC1 (which was > using my newly created cabal-install command-line tool with the Cabal libs > from ghc 7.10). Or at least, I think that's how I got it working. > > HTH, > Doug > > > On Fri, Dec 26, 2014 at 7:05 PM, Konstantine Rybnikov > wrote: > >> Installing dependencies fails with very same error, unfortunately. >> >> On Fri, Dec 26, 2014 at 5:02 PM, Antoine Latter >> wrote: >> >>> I did the following to work around this: >>> >>> I cloned this branch on GitHub: >>> https://github.com/haskell/cabal/tree/1.22 >>> >>> Then, in the cabal-install folder I built the 'cabal-install' binary >>> *without* using the existing version of cabal-install, then used the newly >>> built 'cabal-install' to actually install the new 'cabal-install': >>> >>> cd >>> ghc Setup.hs >>> ./Setup.hs configure >>> ./Seup.hs build >>> dist/build/cabal/cabal install >>> >>> You may need to install some dependencies first - using the old >>> cabal-install worked fine for me for this, but maybe it secretly corrupted >>> something behind the scenes. I haven't had trouble so far. >>> >>> On Fri, Dec 26, 2014 at 2:29 AM, Konstantine Rybnikov >>> wrote: >>> >>>> Hi! >>>> >>>> I just did `sudo make install` on ghc 7.10.1-rc1, removed ~/.ghc and >>>> did `cabal update`. I'm now trying to upgrade to latest cabal by issuing >>>> `cabal install cabal-install`. I get the following: >>>> >>>> ``` >>>> ... >>>> on the commandline: Warning: >>>> -package-name is deprecated: Use -this-package-key instead >>>> ghc: ghc no longer supports single-file style package databases >>>> (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with >>>> the correct format. >>>> Failed to install zlib-0.5.4.2 >>>> cabal: Error: some packages failed to install: >>>> HTTP-3001.0.4 depends on text-1.2.0.3 which failed to install. >>>> cabal-install-0.4.0 depends on zlib-0.5.4.2 which failed to install. >>>> mtl-2.2.1 failed during the building phase. The exception was: >>>> ExitFailure 1 >>>> network-2.6.0.2 failed during the building phase. The exception was: >>>> ExitFailure 1 >>>> parsec-3.1.7 depends on text-1.2.0.3 which failed to install. >>>> text-1.2.0.3 failed during the building phase. The exception was: >>>> ExitFailure 1 >>>> zlib-0.5.4.2 failed during the building phase. The exception was: >>>> ExitFailure 1 >>>> ``` >>>> >>>> Does anyone know a quick-fix? >>>> >>>> Thanks! >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>>> >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dburke.gw at gmail.com Sat Dec 27 23:51:03 2014 From: dburke.gw at gmail.com (Doug Burke) Date: Sat, 27 Dec 2014 18:51:03 -0500 Subject: [Haskell-cafe] ghc 7.10.1-rc1 ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format. In-Reply-To: References: Message-ID: Glad it helped. Doug On Sat, Dec 27, 2014 at 6:23 PM, Konstantine Rybnikov wrote: > Yes, it seems installing latest cabal under ghc 7.8 first and upgrading to > 7.10 afterwards is the way to go. > > Thanks! > > On Sat, Dec 27, 2014 at 2:09 AM, Doug Burke wrote: > >> >> I ended up installing both Cabal and cabal-install (from GitHub) using >> ghc 7.8.4. After that things seemed to get better with ghc 7.10 RC1 (which >> was using my newly created cabal-install command-line tool with the Cabal >> libs from ghc 7.10). Or at least, I think that's how I got it working. >> >> HTH, >> Doug >> >> >> On Fri, Dec 26, 2014 at 7:05 PM, Konstantine Rybnikov >> wrote: >> >>> Installing dependencies fails with very same error, unfortunately. >>> >>> On Fri, Dec 26, 2014 at 5:02 PM, Antoine Latter >>> wrote: >>> >>>> I did the following to work around this: >>>> >>>> I cloned this branch on GitHub: >>>> https://github.com/haskell/cabal/tree/1.22 >>>> >>>> Then, in the cabal-install folder I built the 'cabal-install' binary >>>> *without* using the existing version of cabal-install, then used the newly >>>> built 'cabal-install' to actually install the new 'cabal-install': >>>> >>>> cd >>>> ghc Setup.hs >>>> ./Setup.hs configure >>>> ./Seup.hs build >>>> dist/build/cabal/cabal install >>>> >>>> You may need to install some dependencies first - using the old >>>> cabal-install worked fine for me for this, but maybe it secretly corrupted >>>> something behind the scenes. I haven't had trouble so far. >>>> >>>> On Fri, Dec 26, 2014 at 2:29 AM, Konstantine Rybnikov >>>> wrote: >>>> >>>>> Hi! >>>>> >>>>> I just did `sudo make install` on ghc 7.10.1-rc1, removed ~/.ghc and >>>>> did `cabal update`. I'm now trying to upgrade to latest cabal by issuing >>>>> `cabal install cabal-install`. I get the following: >>>>> >>>>> ``` >>>>> ... >>>>> on the commandline: Warning: >>>>> -package-name is deprecated: Use -this-package-key instead >>>>> ghc: ghc no longer supports single-file style package databases >>>>> (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with >>>>> the correct format. >>>>> Failed to install zlib-0.5.4.2 >>>>> cabal: Error: some packages failed to install: >>>>> HTTP-3001.0.4 depends on text-1.2.0.3 which failed to install. >>>>> cabal-install-0.4.0 depends on zlib-0.5.4.2 which failed to install. >>>>> mtl-2.2.1 failed during the building phase. The exception was: >>>>> ExitFailure 1 >>>>> network-2.6.0.2 failed during the building phase. The exception was: >>>>> ExitFailure 1 >>>>> parsec-3.1.7 depends on text-1.2.0.3 which failed to install. >>>>> text-1.2.0.3 failed during the building phase. The exception was: >>>>> ExitFailure 1 >>>>> zlib-0.5.4.2 failed during the building phase. The exception was: >>>>> ExitFailure 1 >>>>> ``` >>>>> >>>>> Does anyone know a quick-fix? >>>>> >>>>> Thanks! >>>>> >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> Haskell-Cafe at haskell.org >>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>> >>>>> >>>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sun Dec 28 00:13:21 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sat, 27 Dec 2014 16:13:21 -0800 (PST) Subject: [Haskell-cafe] ANN: Groundhog-inspector, a tool for generating datatypes from database In-Reply-To: References: <7152ea95-e861-4514-9732-5356bfb7832e@googlegroups.com> Message-ID: <6c090018-cdda-4784-b89c-a3ff8587ba74@googlegroups.com> Is this what you are looking for? CREATE TABLE itrd_test ( crem_hash character varying(36) NOT NULL, session_hash character varying(36) NOT NULL, test_id character varying(36) NOT NULL, acquisition_type character varying(17) NOT NULL, test_type character varying(18) NOT NULL, offset_from_creation interval, flagged_electrodes character varying[], notes text NOT NULL, CONSTRAINT itrd_test_pkey PRIMARY KEY (test_id), CONSTRAINT itrd_test_crem_hash_fkey FOREIGN KEY (crem_hash) REFERENCES itrd_complaint (crem_hash) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED ) WITH ( OIDS=FALSE ); If not please let me know, my SQL knowledge is not great. On Sunday, December 28, 2014 2:49:24 AM UTC+11, Boris Lykah wrote: > > Thanks for the report. Can you please send the SQL definition of > public.itrd_test? Looking at the code I think that it might have indexes > with expressions. > > On Sat, Dec 27, 2014 at 12:43 AM, > > wrote: > >> Looks like a great idea. I tried it on one of my databases and got the >> following error: >> >> ** Exception: mkUniqueKeyPhantomName: (Just "public","itrd_test")uniques >> list must be not empty >> >> Do you know what that might mean? >> >> On Friday, December 5, 2014 4:07:34 AM UTC+11, Boris Lykah wrote: >>> >>> Hello everyone, >>> >>> I am pleased to announce groundhog-inspector. It analyzes database >>> schema and creates corresponding datatypes and mapping configuration for >>> Groundhog. It works with PostgreSQL, MySQL, and Sqlite. Composite keys, >>> constraints, references across schemas, and other details of schema are >>> reflected in the output. Groundhog-inspector can be used as a library and >>> provides a standalone tool for simple scenarios. >>> >>> Here is an example of the standalone tool usage. JSON mapping in the >>> output was manually converted to YAML for brevity. >>> >>> $ sqlite3 dbfile "CREATE TABLE mytable (id INTEGER PRIMARY KEY NOT NULL, >>> str VARCHAR NOT NULL, ref INTEGER references mytable)" >>> >>> $ groundhog_inspector sqlite dbfile >>> >>> data Mytable >>> = Mytable {mytableStr :: String, >>> mytableRef :: (Maybe (AutoKey Mytable))} >>> >>> - entity: "Mytable" >>> dbName: "mytable" >>> constructors: >>> - name: "Mytable" >>> fields: >>> - name: "mytableStr" >>> dbName: "str" >>> - name: "mytableRef" >>> dbName: "ref" >>> >>> * [Hackage] (http://hackage.haskell.org/package/groundhog-inspector) >>> * [GitHub] (https://github.com/lykahb/groundhog/tree/master/ >>> groundhog-inspector/examples) >>> >>> I would be happy to answer the questions. Enjoy! >>> >>> Regards, >>> Boris Lykah >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskel... at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > Regards, > Boris > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sun Dec 28 00:13:21 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sat, 27 Dec 2014 16:13:21 -0800 (PST) Subject: [Haskell-cafe] ANN: Groundhog-inspector, a tool for generating datatypes from database In-Reply-To: References: <7152ea95-e861-4514-9732-5356bfb7832e@googlegroups.com> Message-ID: <6c090018-cdda-4784-b89c-a3ff8587ba74@googlegroups.com> Is this what you are looking for? CREATE TABLE itrd_test ( crem_hash character varying(36) NOT NULL, session_hash character varying(36) NOT NULL, test_id character varying(36) NOT NULL, acquisition_type character varying(17) NOT NULL, test_type character varying(18) NOT NULL, offset_from_creation interval, flagged_electrodes character varying[], notes text NOT NULL, CONSTRAINT itrd_test_pkey PRIMARY KEY (test_id), CONSTRAINT itrd_test_crem_hash_fkey FOREIGN KEY (crem_hash) REFERENCES itrd_complaint (crem_hash) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED ) WITH ( OIDS=FALSE ); If not please let me know, my SQL knowledge is not great. On Sunday, December 28, 2014 2:49:24 AM UTC+11, Boris Lykah wrote: > > Thanks for the report. Can you please send the SQL definition of > public.itrd_test? Looking at the code I think that it might have indexes > with expressions. > > On Sat, Dec 27, 2014 at 12:43 AM, > > wrote: > >> Looks like a great idea. I tried it on one of my databases and got the >> following error: >> >> ** Exception: mkUniqueKeyPhantomName: (Just "public","itrd_test")uniques >> list must be not empty >> >> Do you know what that might mean? >> >> On Friday, December 5, 2014 4:07:34 AM UTC+11, Boris Lykah wrote: >>> >>> Hello everyone, >>> >>> I am pleased to announce groundhog-inspector. It analyzes database >>> schema and creates corresponding datatypes and mapping configuration for >>> Groundhog. It works with PostgreSQL, MySQL, and Sqlite. Composite keys, >>> constraints, references across schemas, and other details of schema are >>> reflected in the output. Groundhog-inspector can be used as a library and >>> provides a standalone tool for simple scenarios. >>> >>> Here is an example of the standalone tool usage. JSON mapping in the >>> output was manually converted to YAML for brevity. >>> >>> $ sqlite3 dbfile "CREATE TABLE mytable (id INTEGER PRIMARY KEY NOT NULL, >>> str VARCHAR NOT NULL, ref INTEGER references mytable)" >>> >>> $ groundhog_inspector sqlite dbfile >>> >>> data Mytable >>> = Mytable {mytableStr :: String, >>> mytableRef :: (Maybe (AutoKey Mytable))} >>> >>> - entity: "Mytable" >>> dbName: "mytable" >>> constructors: >>> - name: "Mytable" >>> fields: >>> - name: "mytableStr" >>> dbName: "str" >>> - name: "mytableRef" >>> dbName: "ref" >>> >>> * [Hackage] (http://hackage.haskell.org/package/groundhog-inspector) >>> * [GitHub] (https://github.com/lykahb/groundhog/tree/master/ >>> groundhog-inspector/examples) >>> >>> I would be happy to answer the questions. Enjoy! >>> >>> Regards, >>> Boris Lykah >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskel... at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > Regards, > Boris > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sun Dec 28 00:24:25 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sat, 27 Dec 2014 16:24:25 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141227112336.GN31575@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> Message-ID: Thank you, that works. I started down this road but I only got to: instance FromRow IIM where fromRow = IIM <$> field <*> field <*> field <*> T.fromPGArray (fmap T.fromPGArray field) Which I expected to work based on the fact that this is what I need to convert (PGArray (PGArray Double)) to [[Double]]. Why is there an additional fmap needed? On Saturday, December 27, 2014 10:23:47 PM UTC+11, Tom Ellis wrote: > > On Fri, Dec 26, 2014 at 09:31:02PM -0800, in... at rotnetix.com > wrote: > > I would actually like my data IIM to be: > > > > data IIM = IIM {key :: String > > ,itype :: String > > ,idet :: Maybe String > > ,imat :: [[Double]]} deriving (Read, Show, Eq) > > > > But I can't figure out how to get a fromRow instance for that > > instance FromRow IIM where > fromRow = IIM <$> field > <*> field > <*> field > <*> fmap (T.fromPGArray . fmap T.fromPGArray) field > > > PS. I started looking into Opaleye as a possible DSL and would > appreciate > > any help you can give me in figuring out how to represent arrays in > that. > > I am assuming I need to do something with queryRunnerColumn but I was > not > > able to understand the example. > > This is indeed somewhat fiddly to do because it requires fiddling with the > implementation of postgresql-simple instances. Unfortunately that library > does not provide us with enough primitives to do this directly. > > I will work on this. > > Tom > > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sun Dec 28 00:24:25 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sat, 27 Dec 2014 16:24:25 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141227112336.GN31575@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> Message-ID: Thank you, that works. I started down this road but I only got to: instance FromRow IIM where fromRow = IIM <$> field <*> field <*> field <*> T.fromPGArray (fmap T.fromPGArray field) Which I expected to work based on the fact that this is what I need to convert (PGArray (PGArray Double)) to [[Double]]. Why is there an additional fmap needed? On Saturday, December 27, 2014 10:23:47 PM UTC+11, Tom Ellis wrote: > > On Fri, Dec 26, 2014 at 09:31:02PM -0800, in... at rotnetix.com > wrote: > > I would actually like my data IIM to be: > > > > data IIM = IIM {key :: String > > ,itype :: String > > ,idet :: Maybe String > > ,imat :: [[Double]]} deriving (Read, Show, Eq) > > > > But I can't figure out how to get a fromRow instance for that > > instance FromRow IIM where > fromRow = IIM <$> field > <*> field > <*> field > <*> fmap (T.fromPGArray . fmap T.fromPGArray) field > > > PS. I started looking into Opaleye as a possible DSL and would > appreciate > > any help you can give me in figuring out how to represent arrays in > that. > > I am assuming I need to do something with queryRunnerColumn but I was > not > > able to understand the example. > > This is indeed somewhat fiddly to do because it requires fiddling with the > implementation of postgresql-simple instances. Unfortunately that library > does not provide us with enough primitives to do this directly. > > I will work on this. > > Tom > > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sun Dec 28 01:56:28 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sat, 27 Dec 2014 17:56:28 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141227120946.GO31575@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> <20141227120946.GO31575@weber> Message-ID: <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> Thank you very much, that works great. My Haskell, poor as it is, is still a lot better than may SQL so I am doing most of my array operations in Haskell. The only functionality I currently use is array_length, slices (as in SELECT colname [1:2][1:1]) and WHERE colname = '{}'. The other issue I had is once the array select is working is how to select a column with a special name... For some reason out DB designer decided that one of the columns should be named "column". Which is a pain anyway but in normal SQL you can deal with that by selecting it fully qualified as in arrayTable.column but if I try that in opaleye, like: table = Table "arraytable" (required "arraytable.column") the query complains: *** Exception: SqlError {sqlState = "42601", sqlExecStatus = FatalError, sqlErrorMsg = "syntax error at or near \".\"", sqlErrorDetail = "", sqlErrorHint = ""} Finally I am curious as to how easy it will be for me to create a different mapping for PGArray, so that instead of (PGArray (PGArray PGFloat8)) -> [[Double]] I can do (PGArray (PGArray Float8)) -> Matrix Double. It is not a big deal to do the conversion later but if the library allows that kind of thing to be easily done it can make the code more readable. Thanks again for the great support. On Saturday, December 27, 2014 11:09:57 PM UTC+11, Tom Ellis wrote: > > On Sat, Dec 27, 2014 at 11:23:36AM +0000, Tom Ellis wrote: > > > PS. I started looking into Opaleye as a possible DSL and would > appreciate > > > any help you can give me in figuring out how to represent arrays in > that. > > > I am assuming I need to do something with queryRunnerColumn but I was > not > > > able to understand the example. > > > > This is indeed somewhat fiddly to do because it requires fiddling with > the > > implementation of postgresql-simple instances. Unfortunately that > library > > does not provide us with enough primitives to do this directly. > > OK, I just pushed a patch to GitHub > > https://github.com/tomjaguarpaw/haskell-opaleye > > Now you can do the below. You can't actually do anything with your arrays > yet except just read them from tables and return them from `runQuery` but > let me know what functionality you want and I will endevour to support it. > > > import Database.PostgreSQL.Simple (execute_, ConnectInfo(..), > connect) > import Data.String (fromString) > import Opaleye > > connectInfo :: ConnectInfo > connectInfo = ConnectInfo { connectHost = "localhost" > , connectPort = 25433 > , connectUser = "tom" > , connectPassword = "tom" > , connectDatabase = "opaleye_test" } > > table :: Table (Column (PGArray (PGArray PGInt4))) > (Column (PGArray (PGArray PGInt4))) > table = Table "arraytable" (required "colname") > > query :: Query (Column (PGArray (PGArray PGInt4))) > query = queryTable table > > main :: IO () > main = do > conn <- connect connectInfo > > let q = execute_ conn . fromString > > q "DROP TABLE IF EXISTS arraytable" > q "CREATE TABLE arraytable (colname integer[][])" > q "INSERT INTO arraytable VALUES ('{{1,2}, {3,4}}'), ('{{5,6}, {7,8}}')" > > results' <- runQuery conn query :: IO [[[Int]]] > print results' > > -- ghci> main > -- [[[1,2],[3,4]],[[5,6],[7,8]]] > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Sun Dec 28 01:56:28 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sat, 27 Dec 2014 17:56:28 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141227120946.GO31575@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> <20141227120946.GO31575@weber> Message-ID: <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> Thank you very much, that works great. My Haskell, poor as it is, is still a lot better than may SQL so I am doing most of my array operations in Haskell. The only functionality I currently use is array_length, slices (as in SELECT colname [1:2][1:1]) and WHERE colname = '{}'. The other issue I had is once the array select is working is how to select a column with a special name... For some reason out DB designer decided that one of the columns should be named "column". Which is a pain anyway but in normal SQL you can deal with that by selecting it fully qualified as in arrayTable.column but if I try that in opaleye, like: table = Table "arraytable" (required "arraytable.column") the query complains: *** Exception: SqlError {sqlState = "42601", sqlExecStatus = FatalError, sqlErrorMsg = "syntax error at or near \".\"", sqlErrorDetail = "", sqlErrorHint = ""} Finally I am curious as to how easy it will be for me to create a different mapping for PGArray, so that instead of (PGArray (PGArray PGFloat8)) -> [[Double]] I can do (PGArray (PGArray Float8)) -> Matrix Double. It is not a big deal to do the conversion later but if the library allows that kind of thing to be easily done it can make the code more readable. Thanks again for the great support. On Saturday, December 27, 2014 11:09:57 PM UTC+11, Tom Ellis wrote: > > On Sat, Dec 27, 2014 at 11:23:36AM +0000, Tom Ellis wrote: > > > PS. I started looking into Opaleye as a possible DSL and would > appreciate > > > any help you can give me in figuring out how to represent arrays in > that. > > > I am assuming I need to do something with queryRunnerColumn but I was > not > > > able to understand the example. > > > > This is indeed somewhat fiddly to do because it requires fiddling with > the > > implementation of postgresql-simple instances. Unfortunately that > library > > does not provide us with enough primitives to do this directly. > > OK, I just pushed a patch to GitHub > > https://github.com/tomjaguarpaw/haskell-opaleye > > Now you can do the below. You can't actually do anything with your arrays > yet except just read them from tables and return them from `runQuery` but > let me know what functionality you want and I will endevour to support it. > > > import Database.PostgreSQL.Simple (execute_, ConnectInfo(..), > connect) > import Data.String (fromString) > import Opaleye > > connectInfo :: ConnectInfo > connectInfo = ConnectInfo { connectHost = "localhost" > , connectPort = 25433 > , connectUser = "tom" > , connectPassword = "tom" > , connectDatabase = "opaleye_test" } > > table :: Table (Column (PGArray (PGArray PGInt4))) > (Column (PGArray (PGArray PGInt4))) > table = Table "arraytable" (required "colname") > > query :: Query (Column (PGArray (PGArray PGInt4))) > query = queryTable table > > main :: IO () > main = do > conn <- connect connectInfo > > let q = execute_ conn . fromString > > q "DROP TABLE IF EXISTS arraytable" > q "CREATE TABLE arraytable (colname integer[][])" > q "INSERT INTO arraytable VALUES ('{{1,2}, {3,4}}'), ('{{5,6}, {7,8}}')" > > results' <- runQuery conn query :: IO [[[Int]]] > print results' > > -- ghci> main > -- [[[1,2],[3,4]],[[5,6],[7,8]]] > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From phil at darnowsky.com Sun Dec 28 02:45:44 2014 From: phil at darnowsky.com (Phil Darnowsky) Date: Sat, 27 Dec 2014 21:45:44 -0500 Subject: [Haskell-cafe] How to call hUpdateAtHNat with a value known only at runtime In-Reply-To: References: <54976D05.2040406@darnowsky.com> Message-ID: <549F6ED8.6000205@darnowsky.com> Thanks Adam, Andras and Erik for the advice. I think I can get what I want here with the vector-heterogeneous library, if not I'll have to rethink my approach. On 12/23/2014 11:01 PM, adam vogt wrote: > Hi Phil, > > I think you're looking for a function that's sort of like: > >> withInt :: Int -> (forall (n :: HNat). Proxy n -> r) -> r >> withInt 0 f = f hZero >> withInt n f = withInt (n-1) (f . hSucc) > But that one is pretty useless because you can't even supply > hNat2Integral as the second argument: > >> withInt 5 hNat2Integral > Could not deduce (HNat2Integral n) > arising from a use of ?hNat2Integral? > from the context (Integral r) > > That expression typechecks (and gives the value 5 back) if we add that > missing constraint: > >> withInt :: Int -> (forall (n :: HNat). HNat2Integral n => Proxy n -> r) -> r > That's fine, but I don't have a solution for HUpdateAtHNat. The > problem is that the constraint you bring along has to work with any > 'n' but HUpdateAtHNat doesn't typecheck if you try to update beyond > the end of the list, so when I write: > > withIntUp :: HUpdateAtHNat HZero e l > => Proxy '(e,l) > -> Int > -> (forall (n :: HNat). HUpdateAtHNat n e l => Proxy n -> r) > -> r > withIntUp _ 0 f = f hZero > withIntUp p n f = withIntUp p (n-1) (f . hSucc) > > There's a type error: > > Could not deduce (HUpdateAtHNat ('HSucc n) e l) > arising from a use of ?f? > from the context (HUpdateAtHNat 'HZero e l) > > Another sort of solution is http://lpaste.net/117131, but it's > unpleasant to put more things into an ApplyAB instance than you have > to. > > Regards, > Adam > > On Sun, Dec 21, 2014 at 7:59 PM, Phil Darnowsky wrote: >> Hello all, >> >> I'm working on something that involves HLists where I'm making use of the >> hUpdateAtHNat function for array-like semantics, which works great if you >> know the index of the element you want at compile time: >> >> Prelude> :module +Data.HList >> >> Prelude Data.HList> let hl = hEnd $ hBuild "foobar" 123 True >> Loading [a bunch of packages] >> >> Prelude Data.HList> hl >> H["foobar", 123, True] >> >> Prelude Data.HList> hUpdateAtHNat hZero 90909 hl >> H[90909, 123, True] >> >> Prelude Data.HList> hUpdateAtHNat (hSucc hZero) 90909 hl >> H["foobar", 90909, True] >> >> Prelude Data.HList> hUpdateAtHNat (hSucc $ hSucc hZero) 90909 hl >> H["foobar", 123, 90909] >> >> >> So far so good. What's giving me trouble is figuring out how to update at an >> arbitrary index, where that index is only known at runtime, because hZero >> and hSucc are of different types: >> >> Prelude Data.HList> :t hZero >> hZero :: Proxy 'HZero >> >> Prelude Data.HList> :t hSucc hZero >> hSucc hZero :: Proxy ('HSucc 'HZero) >> >> >> What I'd ideally like is some kind of function intToHNatProxy that would >> take an Int and return a Proxy of the appropriate type, but I so far only >> kinda sorta understand how proxies and lifted types work, so I haven't yet >> succeeded in constructing one. Any advice would be very welcome. >> >> Thanks, >> Phil >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Sun Dec 28 13:39:16 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Sun, 28 Dec 2014 13:39:16 +0000 Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> <20141227120946.GO31575@weber> <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> Message-ID: <20141228133916.GC8035@weber> On Sat, Dec 27, 2014 at 05:56:28PM -0800, info at rotnetix.com wrote: > The other issue I had is once the array select is working is how to select > a column with a special name... For some reason out DB designer decided > that one of the columns should be named "column". Which is a pain anyway > but in normal SQL you can deal with that by selecting it fully qualified as > in arrayTable.column but if I try that in opaleye, like: > > table = Table "arraytable" (required "arraytable.column") > > the query complains: > *** Exception: SqlError {sqlState = "42601", sqlExecStatus = FatalError, > sqlErrorMsg = "syntax error at or near \".\"", sqlErrorDetail = "", > sqlErrorHint = ""} This is now fixed in master https://github.com/tomjaguarpaw/haskell-opaleye/commit/3d9946f3f9ea912aa320ed7908357fe3a62dad5f `required "column"` will work (not `required "arraytable.column"`) I fixed it by wrapping column names in double quotes, not by qualifying the names. You yourself may find the former nicer when you write raw SQL. As an aside, using column names that are keywords or not alphanumeric seems to me to be playing with bees (like playing with fire, but more annoying than dangerous). Tom From david.feuer at gmail.com Sun Dec 28 16:02:31 2014 From: david.feuer at gmail.com (David Feuer) Date: Sun, 28 Dec 2014 11:02:31 -0500 Subject: [Haskell-cafe] Is it possible to zip sequences any faster? Message-ID: containers-0.5.6 has a new implementation of zipWith in Data.Sequence that, like the old one, offers O(n) zipping, but unlike the old one offers immediate O((log(min{i,n-i}))^2) access to the elements, where i is the requested index. I haven't been able to think of a way to bring that down from polylogarithmic to logarithmic. The difficulty is that t splits one of the sequences repeatedly, so reaching an element the first time is kind of like pushing a snow shovel all the way down the driveway, rather than throwing snow off to either side. Does anyone have an idea for doing it better, or a good argument that it can't be done? Thanks, David Feuer From info at rotnetix.com Mon Dec 29 02:57:49 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sun, 28 Dec 2014 18:57:49 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141228133916.GC8035@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> <20141227120946.GO31575@weber> <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> <20141228133916.GC8035@weber> Message-ID: <02c65c31-69ac-4203-a9e8-c97da6cfc809@googlegroups.com> Thank you, it works now. I know that it is not advisable to use column names like this, sadly by the time I got involved the DB schema was fixed. On Monday, December 29, 2014 12:39:27 AM UTC+11, Tom Ellis wrote: > > On Sat, Dec 27, 2014 at 05:56:28PM -0800, in... at rotnetix.com > wrote: > > The other issue I had is once the array select is working is how to > select > > a column with a special name... For some reason out DB designer decided > > that one of the columns should be named "column". Which is a pain > anyway > > but in normal SQL you can deal with that by selecting it fully qualified > as > > in arrayTable.column but if I try that in opaleye, like: > > > > table = Table "arraytable" (required "arraytable.column") > > > > the query complains: > > *** Exception: SqlError {sqlState = "42601", sqlExecStatus = FatalError, > > sqlErrorMsg = "syntax error at or near \".\"", sqlErrorDetail = "", > > sqlErrorHint = ""} > > This is now fixed in master > > > https://github.com/tomjaguarpaw/haskell-opaleye/commit/3d9946f3f9ea912aa320ed7908357fe3a62dad5f > > `required "column"` will work (not `required "arraytable.column"`) > > I fixed it by wrapping column names in double quotes, not by qualifying > the > names. You yourself may find the former nicer when you write raw SQL. > > As an aside, using column names that are keywords or not alphanumeric > seems > to me to be playing with bees (like playing with fire, but more annoying > than dangerous). > > Tom > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Mon Dec 29 02:57:49 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sun, 28 Dec 2014 18:57:49 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141228133916.GC8035@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> <20141227120946.GO31575@weber> <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> <20141228133916.GC8035@weber> Message-ID: <02c65c31-69ac-4203-a9e8-c97da6cfc809@googlegroups.com> Thank you, it works now. I know that it is not advisable to use column names like this, sadly by the time I got involved the DB schema was fixed. On Monday, December 29, 2014 12:39:27 AM UTC+11, Tom Ellis wrote: > > On Sat, Dec 27, 2014 at 05:56:28PM -0800, in... at rotnetix.com > wrote: > > The other issue I had is once the array select is working is how to > select > > a column with a special name... For some reason out DB designer decided > > that one of the columns should be named "column". Which is a pain > anyway > > but in normal SQL you can deal with that by selecting it fully qualified > as > > in arrayTable.column but if I try that in opaleye, like: > > > > table = Table "arraytable" (required "arraytable.column") > > > > the query complains: > > *** Exception: SqlError {sqlState = "42601", sqlExecStatus = FatalError, > > sqlErrorMsg = "syntax error at or near \".\"", sqlErrorDetail = "", > > sqlErrorHint = ""} > > This is now fixed in master > > > https://github.com/tomjaguarpaw/haskell-opaleye/commit/3d9946f3f9ea912aa320ed7908357fe3a62dad5f > > `required "column"` will work (not `required "arraytable.column"`) > > I fixed it by wrapping column names in double quotes, not by qualifying > the > names. You yourself may find the former nicer when you write raw SQL. > > As an aside, using column names that are keywords or not alphanumeric > seems > to me to be playing with bees (like playing with fire, but more annoying > than dangerous). > > Tom > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Mon Dec 29 02:59:26 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sun, 28 Dec 2014 18:59:26 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <02c65c31-69ac-4203-a9e8-c97da6cfc809@googlegroups.com> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> <20141227120946.GO31575@weber> <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> <20141228133916.GC8035@weber> <02c65c31-69ac-4203-a9e8-c97da6cfc809@googlegroups.com> Message-ID: <4279217e-8ce5-46fd-bad5-beba5fd9fe6f@googlegroups.com> I am curious as to how easy it will be for me to create a different mapping for PGArray, so that instead of (PGArray (PGArray PGFloat8)) -> [[Double]] I can do (PGArray (PGArray Float8)) -> Matrix Double. It is not a big deal to do the conversion later but if the library allows that kind of thing to be easily done it can make the code more readable. If opaleye is not really intended to do or if it is quite hard just let me know. On Monday, December 29, 2014 1:57:49 PM UTC+11, in... at rotnetix.com wrote: > > Thank you, it works now. I know that it is not advisable to use column > names like this, sadly by the time I got involved the DB schema was fixed. > > On Monday, December 29, 2014 12:39:27 AM UTC+11, Tom Ellis wrote: >> >> On Sat, Dec 27, 2014 at 05:56:28PM -0800, in... at rotnetix.com wrote: >> > The other issue I had is once the array select is working is how to >> select >> > a column with a special name... For some reason out DB designer decided >> > that one of the columns should be named "column". Which is a pain >> anyway >> > but in normal SQL you can deal with that by selecting it fully >> qualified as >> > in arrayTable.column but if I try that in opaleye, like: >> > >> > table = Table "arraytable" (required "arraytable.column") >> > >> > the query complains: >> > *** Exception: SqlError {sqlState = "42601", sqlExecStatus = >> FatalError, >> > sqlErrorMsg = "syntax error at or near \".\"", sqlErrorDetail = "", >> > sqlErrorHint = ""} >> >> This is now fixed in master >> >> >> https://github.com/tomjaguarpaw/haskell-opaleye/commit/3d9946f3f9ea912aa320ed7908357fe3a62dad5f >> >> `required "column"` will work (not `required "arraytable.column"`) >> >> I fixed it by wrapping column names in double quotes, not by qualifying >> the >> names. You yourself may find the former nicer when you write raw SQL. >> >> As an aside, using column names that are keywords or not alphanumeric >> seems >> to me to be playing with bees (like playing with fire, but more annoying >> than dangerous). >> >> Tom >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskel... at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Mon Dec 29 02:59:26 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sun, 28 Dec 2014 18:59:26 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <02c65c31-69ac-4203-a9e8-c97da6cfc809@googlegroups.com> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> <20141227120946.GO31575@weber> <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> <20141228133916.GC8035@weber> <02c65c31-69ac-4203-a9e8-c97da6cfc809@googlegroups.com> Message-ID: <4279217e-8ce5-46fd-bad5-beba5fd9fe6f@googlegroups.com> I am curious as to how easy it will be for me to create a different mapping for PGArray, so that instead of (PGArray (PGArray PGFloat8)) -> [[Double]] I can do (PGArray (PGArray Float8)) -> Matrix Double. It is not a big deal to do the conversion later but if the library allows that kind of thing to be easily done it can make the code more readable. If opaleye is not really intended to do or if it is quite hard just let me know. On Monday, December 29, 2014 1:57:49 PM UTC+11, in... at rotnetix.com wrote: > > Thank you, it works now. I know that it is not advisable to use column > names like this, sadly by the time I got involved the DB schema was fixed. > > On Monday, December 29, 2014 12:39:27 AM UTC+11, Tom Ellis wrote: >> >> On Sat, Dec 27, 2014 at 05:56:28PM -0800, in... at rotnetix.com wrote: >> > The other issue I had is once the array select is working is how to >> select >> > a column with a special name... For some reason out DB designer decided >> > that one of the columns should be named "column". Which is a pain >> anyway >> > but in normal SQL you can deal with that by selecting it fully >> qualified as >> > in arrayTable.column but if I try that in opaleye, like: >> > >> > table = Table "arraytable" (required "arraytable.column") >> > >> > the query complains: >> > *** Exception: SqlError {sqlState = "42601", sqlExecStatus = >> FatalError, >> > sqlErrorMsg = "syntax error at or near \".\"", sqlErrorDetail = "", >> > sqlErrorHint = ""} >> >> This is now fixed in master >> >> >> https://github.com/tomjaguarpaw/haskell-opaleye/commit/3d9946f3f9ea912aa320ed7908357fe3a62dad5f >> >> `required "column"` will work (not `required "arraytable.column"`) >> >> I fixed it by wrapping column names in double quotes, not by qualifying >> the >> names. You yourself may find the former nicer when you write raw SQL. >> >> As an aside, using column names that are keywords or not alphanumeric >> seems >> to me to be playing with bees (like playing with fire, but more annoying >> than dangerous). >> >> Tom >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskel... at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.hidekazu at gmail.com Mon Dec 29 04:39:47 2014 From: i.hidekazu at gmail.com (Hidekazu IWAKI) Date: Mon, 29 Dec 2014 13:39:47 +0900 Subject: [Haskell-cafe] Do you know the author of the paper "Semantic Lego" ? Message-ID: Dear Sirs. I want to introduce the monad theory as a modular denotational semantics. So I am translating a really nice paper "Semantic Lego" into Japanese. But I have not be able to get the agreement of translating and publishing on the web. I already sent e-mails to two contact address. I know them from his homepage http://groups.csail.mit.edu/mac/users/dae/ However the addresses are not use both them. So anyone know him and his e-mail address, could you please forward the following mail to the author Dr. David Espinosa ? It should be noted he seems to work at Google. Sincerely. ------------------ My name is IWAKI Hidekazu and I am an amateur researcher of computer science and a Japanese Wikipedian. I am a Japanese living in Japan. https://ja.wikipedia.org/wiki/%E5%88%A9%E7%94%A8%E8%80%85:I.hidekazu I am concerning the methods of modular denotational semantics(the theory of monads). But for example Lian,Hudak or Wadler's paper is so difficult or not clear. so I can not explain the theory. Your Ph.D thesis "Semantic Lego" is so nice paper for learning the methods. It is very important for every computer scientists and functional programmer interesting in the theory of Monad. I want to translate this paper to Japanese. So could you give me the agreement ofJapanese translation? I am looking forward to hearing from you. Faithfully yours. -- *:..?o??*?????*:..?o??*?????*:..?o??*????? *??????????????? *???: i.hidekazu at gmail.com *:..?o??*?????*:..?o??*?????*:..?o??*????? From info at rotnetix.com Mon Dec 29 06:01:27 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Sun, 28 Dec 2014 22:01:27 -0800 (PST) Subject: [Haskell-cafe] Postgresql Intervals with Opaleye Message-ID: Another opaleye question: What type should I use for the postgresql interval type? Thanks Riaan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ky3 at atamo.com Mon Dec 29 08:56:54 2014 From: ky3 at atamo.com (Kim-Ee Yeoh) Date: Mon, 29 Dec 2014 15:56:54 +0700 Subject: [Haskell-cafe] Do you know the author of the paper "Semantic Lego" ? In-Reply-To: References: Message-ID: If you have any connections to Google employees, say those in Japan, you could try that network. Frankly, the whole idea of translating a published CS thesis is so benign that this is a slamdunk for "Asking forgiveness is easier than asking permission." As in, upstanding citizens of sterling moral repute wouldn't bat an eyelid over this. On 12/29/14, Hidekazu IWAKI wrote: > Dear Sirs. > > I want to introduce the monad theory as a modular denotational semantics. > So I am translating a really nice paper "Semantic Lego" into Japanese. > > But I have not be able to get the agreement of translating and > publishing on the web. > I already sent e-mails to two contact address. I know them from his homepage > http://groups.csail.mit.edu/mac/users/dae/ > However the addresses are not use both them. > > > So anyone know him and his e-mail address, could you please forward > the following mail to > the author Dr. David Espinosa ? > It should be noted he seems to work at Google. > > Sincerely. > ------------------ > > My name is IWAKI Hidekazu and I am an amateur researcher of computer science > and a Japanese Wikipedian. I am a Japanese living in Japan. > https://ja.wikipedia.org/wiki/%E5%88%A9%E7%94%A8%E8%80%85:I.hidekazu > > I am concerning the methods of modular denotational semantics(the > theory of monads). > But for example Lian,Hudak or Wadler's paper is so difficult or not > clear. so I can not explain the theory. > > Your Ph.D thesis "Semantic Lego" is so nice paper for learning the methods. > It is very important for every computer scientists and functional > programmer interesting in the theory of Monad. > > I want to translate this paper to Japanese. So could you give me the > agreement ofJapanese translation? > > I am looking forward to hearing from you. > Faithfully yours. > > -- > *:..?o??*?????*:..?o??*?????*:..?o??*????? > *??????????????? > *???: i.hidekazu at gmail.com > *:..?o??*?????*:..?o??*?????*:..?o??*????? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- -- Kim-Ee From jmaessen at alum.mit.edu Mon Dec 29 15:01:11 2014 From: jmaessen at alum.mit.edu (Jan-Willem Maessen) Date: Mon, 29 Dec 2014 10:01:11 -0500 Subject: [Haskell-cafe] Do you know the author of the paper "Semantic Lego" ? In-Reply-To: References: Message-ID: I've sent this along to David Espinosa; note that it might take a little while for him to respond as it's the holiday season in the US and many people are out of town. -Jan-Willem Maessen On Sun, Dec 28, 2014 at 11:39 PM, Hidekazu IWAKI wrote: > Dear Sirs. > > I want to introduce the monad theory as a modular denotational semantics. > So I am translating a really nice paper "Semantic Lego" into Japanese. > > But I have not be able to get the agreement of translating and > publishing on the web. > I already sent e-mails to two contact address. I know them from his > homepage > http://groups.csail.mit.edu/mac/users/dae/ > However the addresses are not use both them. > > > So anyone know him and his e-mail address, could you please forward > the following mail to > the author Dr. David Espinosa ? > It should be noted he seems to work at Google. > > Sincerely. > ------------------ > > My name is IWAKI Hidekazu and I am an amateur researcher of computer > science > and a Japanese Wikipedian. I am a Japanese living in Japan. > https://ja.wikipedia.org/wiki/%E5%88%A9%E7%94%A8%E8%80%85:I.hidekazu > > I am concerning the methods of modular denotational semantics(the > theory of monads). > But for example Lian,Hudak or Wadler's paper is so difficult or not > clear. so I can not explain the theory. > > Your Ph.D thesis "Semantic Lego" is so nice paper for learning the methods. > It is very important for every computer scientists and functional > programmer interesting in the theory of Monad. > > I want to translate this paper to Japanese. So could you give me the > agreement ofJapanese translation? > > I am looking forward to hearing from you. > Faithfully yours. > > -- > *:..?o??*?????*:..?o??*?????*:..?o??*????? > *?? ?????? ????? > *???: i.hidekazu at gmail.com > *:..?o??*?????*:..?o??*?????*:..?o??*????? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Tue Dec 30 01:16:30 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Mon, 29 Dec 2014 17:16:30 -0800 Subject: [Haskell-cafe] macosx-app on Yosemite Message-ID: Dear list, I tried to install wxHaskell, following these instructions: https://www.haskell.org/haskellwiki/WxHaskell/Mac It lists some configurations known to work, but I am running OS X 10.10,which is not among them. "brew install wxmac --devel" reported no errors. Next, "cabal install wx cabal-macosx" reported no errors. Next, "ghc --make HelloWorld.hs" reported no errors. But when I try to run "macosx-app HelloWorld", I get "-bash: macosx-app: command not found". Below is a transcript of the installation process, tab-indented for ease of viewing. Many thanks, Jeff ---- this worked: Jefferys-MBP:~ jbb$ brew install wxmac --devel ==> Installing dependencies for wxmac: jpeg, libpng, libtiff ==> Installing wxmac dependency: jpeg ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/jpeg-8d.yosemi ######################################################################## 100.0% ==> Pouring jpeg-8d.yosemite.bottle.2.tar.gz [image: ?] /usr/local/Cellar/jpeg/8d: 18 files, 776K ==> Installing wxmac dependency: libpng ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.6.15. ######################################################################## 100.0% ==> Pouring libpng-1.6.15.yosemite.bottle.tar.gz [image: ?] /usr/local/Cellar/libpng/1.6.15: 17 files, 1.3M ==> Installing wxmac dependency: libtiff ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libtiff-4.0.3. ######################################################################## 100.0% ==> Pouring libtiff-4.0.3.yosemite.bottle.tar.gz [image: ?] /usr/local/Cellar/libtiff/4.0.3: 254 files, 3.8M ==> Installing wxmac ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/wxmac-3.0.2.yo ######################################################################## 100.0% ==> Pouring wxmac-3.0.2.yosemite.bottle.9.tar.gz [image: ?] /usr/local/Cellar/wxmac/3.0.2: 777 files, 41M Jefferys-MBP:~ jbb$ next, this worked: Last login: Sun Dec 28 15:38:02 on ttys000 Jefferys-MBP:~ jbb$ cabal install wx cabal-macosx Resolving dependencies... Downloading fgl-5.4.2.4... Configuring wxc-0.91.0.0... Configuring fgl-5.4.2.4... Building fgl-5.4.2.4... Building wxc-0.91.0.0... Installed fgl-5.4.2.4 Downloading cabal-macosx-0.2.3... Configuring cabal-macosx-0.2.3... Building cabal-macosx-0.2.3... Installed cabal-macosx-0.2.3 Installed wxc-0.91.0.0 Downloading wxcore-0.91.0.0... Configuring wxcore-0.91.0.0... Building wxcore-0.91.0.0... Installed wxcore-0.91.0.0 Downloading wx-0.91.0.0... Configuring wx-0.91.0.0... Building wx-0.91.0.0... Installed wx-0.91.0.0 Updating documentation index /Users/jbb/Library/Haskell/share/doc/index.html Jefferys-MBP:~ jbb$ next, this failed: Jefferys-MBP:wxHaskell jbb$ date Mon Dec 29 16:56:05 PST 2014 Jefferys-MBP:wxHaskell jbb$ pwd /Users/jbb/Mine/fun/computer/Haskell/wxHaskell Jefferys-MBP:wxHaskell jbb$ ls HelloWorld.hs Jefferys-MBP:wxHaskell jbb$ ghc --make HelloWorld.hs [1 of 1] Compiling Main ( HelloWorld.hs, HelloWorld.o ) Linking HelloWorld ... Jefferys-MBP:wxHaskell jbb$ macosx-app HelloWorld -bash: macosx-app: command not found Jefferys-MBP:wxHaskell jbb$ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: emoji_u1f37a.png Type: image/png Size: 1818 bytes Desc: not available URL: From allbery.b at gmail.com Tue Dec 30 01:19:09 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 29 Dec 2014 20:19:09 -0500 Subject: [Haskell-cafe] macosx-app on Yosemite In-Reply-To: References: Message-ID: On Mon, Dec 29, 2014 at 8:16 PM, Jeffrey Brown wrote: > "brew install wxmac --devel" reported no errors. > Next, "cabal install wx cabal-macosx" reported no errors. > Next, "ghc --make HelloWorld.hs" reported no errors. > But when I try to run "macosx-app HelloWorld", I get "-bash: macosx-app: > command not found". > That just means you didn't add $HOME/.cabal/bin or $HOME/Library/Haskell/bin (depending on where you got your ghc+cabal from) to $PATH. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Tue Dec 30 01:33:34 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Mon, 29 Dec 2014 17:33:34 -0800 Subject: [Haskell-cafe] macosx-app on Yosemite In-Reply-To: References: Message-ID: Yes, that was the problem. Thanks, Brandon! On Mon, Dec 29, 2014 at 5:19 PM, Brandon Allbery wrote: > On Mon, Dec 29, 2014 at 8:16 PM, Jeffrey Brown > wrote: > >> "brew install wxmac --devel" reported no errors. >> Next, "cabal install wx cabal-macosx" reported no errors. >> Next, "ghc --make HelloWorld.hs" reported no errors. >> But when I try to run "macosx-app HelloWorld", I get "-bash: macosx-app: >> command not found". >> > > That just means you didn't add $HOME/.cabal/bin or > $HOME/Library/Haskell/bin (depending on where you got your ghc+cabal from) > to $PATH. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.gibiansky at gmail.com Tue Dec 30 04:27:34 2014 From: andrew.gibiansky at gmail.com (Andrew Gibiansky) Date: Mon, 29 Dec 2014 23:27:34 -0500 Subject: [Haskell-cafe] User-Controlled Defaulting Proposals? Message-ID: Hey all, I wish Haskell gave typeclass authors more control over defaulting. I see there are a number of proposals here: https://ghc.haskell.org/trac/haskell-prime/wiki/Defaulting Are any of these being actively pursued? If not, why not, and if so, what proposals will potentially make it into Haskell eventually? Just curious, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Tue Dec 30 10:01:05 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 30 Dec 2014 10:01:05 +0000 Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <4279217e-8ce5-46fd-bad5-beba5fd9fe6f@googlegroups.com> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> <20141227120946.GO31575@weber> <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> <20141228133916.GC8035@weber> <02c65c31-69ac-4203-a9e8-c97da6cfc809@googlegroups.com> <4279217e-8ce5-46fd-bad5-beba5fd9fe6f@googlegroups.com> Message-ID: <20141230100105.GA11576@weber> On Sun, Dec 28, 2014 at 06:59:26PM -0800, info at rotnetix.com wrote: > I am curious as to how easy it will be for me to create a different mapping > for PGArray, so that instead of (PGArray (PGArray PGFloat8)) -> [[Double]] > I can do (PGArray (PGArray Float8)) -> Matrix Double. It is not a big deal > to do the conversion later but if the library allows that kind of thing to > be easily done it can make the code more readable. Sure, you could do it by adding a QueryRunnerDefault instance or just a QueryRunner instance for a compound type like the FromRow instance for IIM. Tom From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Tue Dec 30 10:03:24 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 30 Dec 2014 10:03:24 +0000 Subject: [Haskell-cafe] Postgresql Intervals with Opaleye In-Reply-To: References: Message-ID: <20141230100323.GB11576@weber> On Sun, Dec 28, 2014 at 10:01:27PM -0800, info at rotnetix.com wrote: > Another opaleye question: > What type should I use for the postgresql interval type? It seems that postgresql-simple doesn't support the interval type so the first step would be to get it added there. Tom From ky3 at atamo.com Tue Dec 30 13:20:52 2014 From: ky3 at atamo.com (Kim-Ee Yeoh) Date: Tue, 30 Dec 2014 20:20:52 +0700 Subject: [Haskell-cafe] User-Controlled Defaulting Proposals? In-Reply-To: References: Message-ID: > I wish Haskell gave typeclass authors more control over defaulting. > If you could flesh out your case more, social momentum will build more rapidly to push things through. What concrete problem are you trying to solve with finer-grained defaulting? -- Kim-Ee -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Tue Dec 30 16:23:25 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 30 Dec 2014 16:23:25 +0000 Subject: [Haskell-cafe] Encoding for flow charts In-Reply-To: References: Message-ID: <20141230162325.GF11576@weber> On Thu, Dec 25, 2014 at 04:34:19PM -0700, Richard Wallace wrote: > I've been working to encode a fairly complex flow chart. What precisely do you mean by "flow chart"? If you mean something loosely described as "a sequence of nodes which lets you perform actions and choose a next path based on the results of those actions" then isn't each node just `M Bool` for some monad of appropriate actions `M`? Tom From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Tue Dec 30 16:30:02 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 30 Dec 2014 16:30:02 +0000 Subject: [Haskell-cafe] Encoding for flow charts In-Reply-To: <20141230162325.GF11576@weber> References: <20141230162325.GF11576@weber> Message-ID: <20141230163001.GG11576@weber> On Tue, Dec 30, 2014 at 04:23:25PM +0000, Tom Ellis wrote: > On Thu, Dec 25, 2014 at 04:34:19PM -0700, Richard Wallace wrote: > > I've been working to encode a fairly complex flow chart. > > What precisely do you mean by "flow chart"? > > If you mean something loosely described as "a sequence of nodes which lets > you perform actions and choose a next path based on the results of those > actions" then isn't each node just `M Bool` for some monad of appropriate > actions `M`? For example here is the flowchart from the top of http://en.wikipedia.org/wiki/Flowchart implemented as I describe: plugInLamp :: M () replaceBulb :: M () repairLamp :: M () lampPluggedIn :: M Bool bulbBurnedOut :: M Bool lampDoesn'tWork :: M () lampDoesn'tWork = do p <- lampPluggedIn if not p then plugInLamp else do b <- bulbBurnedOut if b then replaceBulb else repairLamp From jkarni at gmail.com Tue Dec 30 17:20:02 2014 From: jkarni at gmail.com (Julian Arni) Date: Tue, 30 Dec 2014 18:20:02 +0100 Subject: [Haskell-cafe] Type-directed functions Message-ID: Hi all, I've been playing around with what might be described as type-directed functions. One example is a list-like structure of phantom-typed values {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} import GHC.TypeLits infixr 6 ::: data a ::: b = a ::: b deriving (Show, Eq) data Tag b = Tag String deriving (Show, Eq) ex1 :: Tag 5 ::: Tag 3 ::: Tag 7 ex1 = Tag "Alice" ::: Tag "Bob" ::: Tag "Carol" And then sorting 'ex1' based on the Nats, such that sort ex1 :: Tag 3 ::: Tag 5 ::: Tag 7 sort ex1 = Tag "Bob" ::: Tag "Alice" ::: Tag "Carol" Notice how it's the types, not the values, that determine the result, but that the value-level also changes. I know how to do this using classes, but it's a little excruciating - it's like programming in a verbose and very restricted Prolog. With type families it's much easier to get the result *type* (pattern matching is simple, recursive calls are natural, and it all looks a lot more like Haskell), but I haven't yet seen a way of effectively using type families to direct the value-level component of the calculation. Are there any examples of how this might be done? Or are there other alternatives to using type-classes that I am missing? Or, alternatively, are there libraries to reduce the boilerplate of this type-class code? Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.gibiansky at gmail.com Tue Dec 30 17:45:43 2014 From: andrew.gibiansky at gmail.com (Andrew Gibiansky) Date: Tue, 30 Dec 2014 12:45:43 -0500 Subject: [Haskell-cafe] User-Controlled Defaulting Proposals? In-Reply-To: References: Message-ID: Mostly, I am curious about general efforts in the area. I personally would like a mechanism by which type class instances may be used for type inference. Specifically, I wish there were some mechanism by which I could say, if there is only one instance of a typeclass available, choose it and proceed with type inference. This is somewhat what defaulting currently allows. Here is some code that I would like to "emulate" class FromInt a where fromInt :: Int -> a instance FromInt String where fromInt = show instance FromInt Int where fromInt = id class Go a where go :: a -> IO () instance Go Int where go = print -- No type signature necessary anywhere main = go $ fromInt 3 Here, I would like `fromInt 3` to be defaulted to `Int`, as that is the only possible instance that `Go` allows; once it is defaulted, then type inference can continue as normal, choosing the appropriate `FromInt` instance. (Of course, I do not mean for the code as written above to have backwards incompatible behaviour; instead probably some syntactic changes would indicate that "Go" is somehow defaultable, etc etc) Note that this proposal is far from "fleshed out" and I don't have any suggestions for how Haskell might move in such a direction in the immediate future; I am more just curious whether work has been done in this area or what other options may be. Using typeclass instances for type resolution would allow clever design to get rid of "ambiguous variable" errors, and allow us to write cleaner code without as many type annotations (which is what defaulting allows for numeric literals). -- Andrew On Tue, Dec 30, 2014 at 8:20 AM, Kim-Ee Yeoh wrote: > > I wish Haskell gave typeclass authors more control over defaulting. >> > > If you could flesh out your case more, social momentum will build more > rapidly to push things through. > > What concrete problem are you trying to solve with finer-grained > defaulting? > > -- Kim-Ee > -------------- next part -------------- An HTML attachment was scrubbed... URL: From atzeus at gmail.com Tue Dec 30 17:47:54 2014 From: atzeus at gmail.com (Atze van der Ploeg) Date: Tue, 30 Dec 2014 18:47:54 +0100 Subject: [Haskell-cafe] Type-directed functions In-Reply-To: References: Message-ID: Hi Julian, Check out my package ctrex. https://www.haskell.org/haskellwiki/CTRex Cheers, Atze On Dec 30, 2014 6:20 PM, "Julian Arni" wrote: > Hi all, > > I've been playing around with what might be described as type-directed > functions. One example is a list-like structure of phantom-typed values > > {-# LANGUAGE TypeOperators #-} > {-# LANGUAGE DataKinds #-} > {-# LANGUAGE PolyKinds #-} > > import GHC.TypeLits > > infixr 6 ::: > data a ::: b = a ::: b > deriving (Show, Eq) > > data Tag b = Tag String > deriving (Show, Eq) > > ex1 :: Tag 5 ::: Tag 3 ::: Tag 7 > ex1 = Tag "Alice" ::: Tag "Bob" ::: Tag "Carol" > > > And then sorting 'ex1' based on the Nats, such that > > sort ex1 :: Tag 3 ::: Tag 5 ::: Tag 7 > sort ex1 = Tag "Bob" ::: Tag "Alice" ::: Tag "Carol" > > Notice how it's the types, not the values, that determine the result, but > that the value-level also changes. > > I know how to do this using classes, but it's a little excruciating - it's > like programming in a verbose and very restricted Prolog. With type > families > it's much easier to get the result *type* (pattern matching is simple, > recursive calls are natural, and it all looks a lot more like Haskell), > but > I haven't yet seen a way of effectively using type families to direct > the value-level component of the calculation. > > Are there any examples of how this might be done? Or are there other > alternatives to using type-classes that I am missing? Or, alternatively, > are > there libraries to reduce the boilerplate of this type-class code? > > Thanks, > Julian > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Tue Dec 30 19:35:42 2014 From: johan.tibell at gmail.com (Johan Tibell) Date: Tue, 30 Dec 2014 14:35:42 -0500 Subject: [Haskell-cafe] Cabal 1.22 RC ready to test Message-ID: Hi all, I've now prepared release candidate for Cabal/cabal-install 1.22. Please test them and report bugs here and/or on the bug tracker ( https://github.com/haskell/cabal/issues). To install: cabal install http://johantibell.com/files/Cabal-1.22.0.0-rc.tar.gz http://johantibell.com/files/cabal-install-1.22.0.0-rc.tar.gz Cabal is now such a big project that's used in so many context (e.g. different OSes) that we need your help to help us test, to make sure that new releases work for you. -- Johan -------------- next part -------------- An HTML attachment was scrubbed... URL: From djsamperi at gmail.com Tue Dec 30 22:42:52 2014 From: djsamperi at gmail.com (Dominick Samperi) Date: Tue, 30 Dec 2014 17:42:52 -0500 Subject: [Haskell-cafe] Haskell Package for Fedora 21? Message-ID: It appears that there are some problems using the Haskell Package with Fedora Linux 21. After following the instructions for Debian Linux, an attempt to start ghci yields this: $ ghci Loading packatge ghc-prim ... linking done. Loading package integer-gmp .. : can't load .so/.DLL for: libgmp.so (cannot open shared object). Adding /usr/lib64 or /usr/lib64/openssl/engines to LD_LIBRARY_PATH doesn't help, even though libgmp.so is located in the latter directory. Are there work-arounds for this? Are there best practices for Fedora 21? Compile from source? Thanks, Dominick From rasen.dubi at gmail.com Tue Dec 30 23:02:57 2014 From: rasen.dubi at gmail.com (Alexey Shmalko) Date: Wed, 31 Dec 2014 01:02:57 +0200 Subject: [Haskell-cafe] Haskell Package for Fedora 21? In-Reply-To: References: Message-ID: > Adding /usr/lib64 or /usr/lib64/openssl/engines to LD_LIBRARY_PATH doesn't help, > even though libgmp.so is located in the latter directory. Are you sure you have libgmp.so and not libgmp.so.3? If you have libgmp.so.3, you should symlink libgmp.so to libgmp.so.3 or install package with libgmp.so. You could also try using strace. System call trace should help figuring out what's going on. Regards, Alexey -------------- next part -------------- An HTML attachment was scrubbed... URL: From djsamperi at gmail.com Wed Dec 31 00:54:29 2014 From: djsamperi at gmail.com (Dominick Samperi) Date: Tue, 30 Dec 2014 19:54:29 -0500 Subject: [Haskell-cafe] Haskell Package for Fedora 21? In-Reply-To: References: Message-ID: Thanks, I should have been more precise. It is possible to install an older version of Haskell Platform (containing ghc 7.6.3) in the usual Fedora 21 way: yum -y install haskell-platform. I am trying to install the most recent version of the Haskell Platform, version 2014.2.0.0, and for this only a Debian binary is provided. This doesn't work under Fedora 21. I tried using the source distribution for HP 2014.2.0.0, and this requires an already installed HP, so I installed the one that includes ghc 7.6.3. The build of the source distribution failed on the step that tries to create hptool due to "cannot satisfy" applied to hastache-0.6.1... On Tue, Dec 30, 2014 at 6:02 PM, Alexey Shmalko wrote: >> Adding /usr/lib64 or /usr/lib64/openssl/engines to LD_LIBRARY_PATH doesn't >> help, >> even though libgmp.so is located in the latter directory. > > Are you sure you have libgmp.so and not libgmp.so.3? > > If you have libgmp.so.3, you should symlink libgmp.so to libgmp.so.3 or > install package with libgmp.so. > > You could also try using strace. System call trace should help figuring out > what's going on. > > Regards, > Alexey From info at rotnetix.com Wed Dec 31 00:59:29 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Tue, 30 Dec 2014 16:59:29 -0800 (PST) Subject: [Haskell-cafe] Postgresql Intervals with Opaleye In-Reply-To: <20141230100323.GB11576@weber> References: <20141230100323.GB11576@weber> Message-ID: That might be tricky... See https://github.com/lpsmith/postgresql-simple/pull/115, it seems like it is not trivial to get the conversions to haskell types correct. Look like I am back to native SQL for that one. On Tuesday, December 30, 2014 9:03:32 PM UTC+11, Tom Ellis wrote: > > On Sun, Dec 28, 2014 at 10:01:27PM -0800, in... at rotnetix.com > wrote: > > Another opaleye question: > > What type should I use for the postgresql interval type? > > It seems that postgresql-simple doesn't support the interval type so the > first step would be to get it added there. > > Tom > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Wed Dec 31 00:59:29 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Tue, 30 Dec 2014 16:59:29 -0800 (PST) Subject: [Haskell-cafe] Postgresql Intervals with Opaleye In-Reply-To: <20141230100323.GB11576@weber> References: <20141230100323.GB11576@weber> Message-ID: That might be tricky... See https://github.com/lpsmith/postgresql-simple/pull/115, it seems like it is not trivial to get the conversions to haskell types correct. Look like I am back to native SQL for that one. On Tuesday, December 30, 2014 9:03:32 PM UTC+11, Tom Ellis wrote: > > On Sun, Dec 28, 2014 at 10:01:27PM -0800, in... at rotnetix.com > wrote: > > Another opaleye question: > > What type should I use for the postgresql interval type? > > It seems that postgresql-simple doesn't support the interval type so the > first step would be to get it added there. > > Tom > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Wed Dec 31 01:01:06 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Tue, 30 Dec 2014 17:01:06 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141230100105.GA11576@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> <20141227120946.GO31575@weber> <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> <20141228133916.GC8035@weber> <02c65c31-69ac-4203-a9e8-c97da6cfc809@googlegroups.com> <4279217e-8ce5-46fd-bad5-beba5fd9fe6f@googlegroups.com> <20141230100105.GA11576@weber> Message-ID: <308d3305-cd01-4e03-80ee-40c8cbbbc875@googlegroups.com> Would you be willing to send me an example of how I would do that please? Thanks Riaan On Tuesday, December 30, 2014 9:01:19 PM UTC+11, Tom Ellis wrote: > > On Sun, Dec 28, 2014 at 06:59:26PM -0800, in... at rotnetix.com > wrote: > > I am curious as to how easy it will be for me to create a different > mapping > > for PGArray, so that instead of (PGArray (PGArray PGFloat8)) -> > [[Double]] > > I can do (PGArray (PGArray Float8)) -> Matrix Double. It is not a big > deal > > to do the conversion later but if the library allows that kind of thing > to > > be easily done it can make the code more readable. > > Sure, you could do it by adding a QueryRunnerDefault instance or just a > QueryRunner instance for a compound type like the FromRow instance for > IIM. > > Tom > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at rotnetix.com Wed Dec 31 01:01:06 2014 From: info at rotnetix.com (info at rotnetix.com) Date: Tue, 30 Dec 2014 17:01:06 -0800 (PST) Subject: [Haskell-cafe] Handling Postgresql array types In-Reply-To: <20141230100105.GA11576@weber> References: <20141226105246.GI31575@weber> <20141226110212.GJ31575@weber> <5bde06c8-bbdd-4a6a-b93c-5b02c7628139@googlegroups.com> <20141227112336.GN31575@weber> <20141227120946.GO31575@weber> <1b102f5b-a5b6-4950-a6d1-840ee048302b@googlegroups.com> <20141228133916.GC8035@weber> <02c65c31-69ac-4203-a9e8-c97da6cfc809@googlegroups.com> <4279217e-8ce5-46fd-bad5-beba5fd9fe6f@googlegroups.com> <20141230100105.GA11576@weber> Message-ID: <308d3305-cd01-4e03-80ee-40c8cbbbc875@googlegroups.com> Would you be willing to send me an example of how I would do that please? Thanks Riaan On Tuesday, December 30, 2014 9:01:19 PM UTC+11, Tom Ellis wrote: > > On Sun, Dec 28, 2014 at 06:59:26PM -0800, in... at rotnetix.com > wrote: > > I am curious as to how easy it will be for me to create a different > mapping > > for PGArray, so that instead of (PGArray (PGArray PGFloat8)) -> > [[Double]] > > I can do (PGArray (PGArray Float8)) -> Matrix Double. It is not a big > deal > > to do the conversion later but if the library allows that kind of thing > to > > be easily done it can make the code more readable. > > Sure, you could do it by adding a QueryRunnerDefault instance or just a > QueryRunner instance for a compound type like the FromRow instance for > IIM. > > Tom > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.miljenovic at gmail.com Wed Dec 31 01:02:59 2014 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Wed, 31 Dec 2014 11:02:59 +1000 Subject: [Haskell-cafe] Haskell Package for Fedora 21? In-Reply-To: References: Message-ID: On 31 December 2014 at 10:54, Dominick Samperi wrote: > Thanks, > > I should have been more precise. It is possible to install an older > version of Haskell Platform (containing ghc 7.6.3) in the usual > Fedora 21 way: yum -y install haskell-platform. > > I am trying to install the most recent version of the Haskell > Platform, version 2014.2.0.0, and for this only a Debian > binary is provided. This doesn't work under Fedora 21. > > I tried using the source distribution for HP 2014.2.0.0, and this > requires an already installed HP, so I installed the one that > includes ghc 7.6.3. The build of the source distribution failed > on the step that tries to create hptool due to "cannot satisfy" > applied to hastache-0.6.1... It's not the entire platform, but you can install a newer GHC on Fedora 21 from here: https://copr.fedoraproject.org/coprs/petersen/ghc-7.8/ > > > On Tue, Dec 30, 2014 at 6:02 PM, Alexey Shmalko wrote: >>> Adding /usr/lib64 or /usr/lib64/openssl/engines to LD_LIBRARY_PATH doesn't >>> help, >>> even though libgmp.so is located in the latter directory. >> >> Are you sure you have libgmp.so and not libgmp.so.3? >> >> If you have libgmp.so.3, you should symlink libgmp.so to libgmp.so.3 or >> install package with libgmp.so. >> >> You could also try using strace. System call trace should help figuring out >> what's going on. >> >> Regards, >> Alexey > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From djsamperi at gmail.com Wed Dec 31 01:03:31 2014 From: djsamperi at gmail.com (Dominick Samperi) Date: Tue, 30 Dec 2014 20:03:31 -0500 Subject: [Haskell-cafe] Haskell Platform for Fedora 21? Message-ID: The thread with title "Haskell Package for Fedora 21?" should have title "Haskell Platform for Fedora 21?" Sorry about the noise... From toby at paccrat.org Wed Dec 31 09:48:10 2014 From: toby at paccrat.org (Toby Goodwin) Date: 31 Dec 2014 09:48:10 -0000 Subject: [Haskell-cafe] Haskell Package for Fedora 21? In-Reply-To: References: Message-ID: <1420019290.10551.lithium.flare.email@hydrogen.mpv6.com> On Tue, 30 Dec 2014 19:54:29 -0500, Dominick Samperi wrote: >I tried using the source distribution for HP 2014.2.0.0, and this >requires an already installed HP, so I installed the one that >includes ghc 7.6.3. I've done exactly this successfully, although I think I had to build hptool "by hand" for some reason, something like this: cd hptool; cabal install --only-dep; cabal build Then invoke hptool with the CentOS binary build of ghc-7.8.3. If you're still stuck, feel free to contact me directly, and I'll see if I can help. Toby. From takenobu.hs at gmail.com Wed Dec 31 15:40:55 2014 From: takenobu.hs at gmail.com (Takenobu Tani) Date: Thu, 1 Jan 2015 00:40:55 +0900 Subject: [Haskell-cafe] GHC(STG,Cmm,asm) illustrated for hardware persons Message-ID: Dear Haskellers, I love haskell. I'm studying and playing around with Haskell, GHC, STG, Cmm, asm... When I started studying them, I wanted some figures. I've not have some mental models because I am a hardware person. So I am drawing few illustrations for hardware persons. Here is: GHC(STG,Cmm,asm) illustrated for hardware persons http://takenobu-hs.github.io/downloads/haskell_ghc_illustrated.pdf https://github.com/takenobu-hs/haskell-ghc-illustrated If there are some misunderstandings or errors, please teach me. I'll correct or remove them. Thank you :-) I wish you a happy new year, Takenobu -------------- next part -------------- An HTML attachment was scrubbed... URL: From roma at ro-che.info Wed Dec 31 15:49:15 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Wed, 31 Dec 2014 17:49:15 +0200 Subject: [Haskell-cafe] GHC(STG, Cmm, asm) illustrated for hardware persons In-Reply-To: References: Message-ID: <54A41AFB.4000100@ro-che.info> Hey Takenobu, great job! I especially liked the presence of references. On 31/12/14 17:40, Takenobu Tani wrote: > Dear Haskellers, > > I love haskell. > I'm studying and playing around with Haskell, GHC, STG, Cmm, asm... > > When I started studying them, I wanted some figures. > I've not have some mental models because I am a hardware person. > > So I am drawing few illustrations for hardware persons. Here is: > > GHC(STG,Cmm,asm) illustrated for hardware persons > http://takenobu-hs.github.io/downloads/haskell_ghc_illustrated.pdf > https://github.com/takenobu-hs/haskell-ghc-illustrated > > If there are some misunderstandings or errors, please teach me. > I'll correct or remove them. > > Thank you :-) > > > I wish you a happy new year, > Takenobu > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From noteed at gmail.com Wed Dec 31 15:50:47 2014 From: noteed at gmail.com (Vo Minh Thu) Date: Wed, 31 Dec 2014 16:50:47 +0100 Subject: [Haskell-cafe] GHC(STG, Cmm, asm) illustrated for hardware persons In-Reply-To: <54A41AFB.4000100@ro-che.info> References: <54A41AFB.4000100@ro-che.info> Message-ID: Indeed this is very nice. I posted it on reddit[0] where it might get some feedback. [0] http://www.reddit.com/r/haskell/comments/2qxcmz/ghc_illustrated_pdf/ 2014-12-31 16:49 GMT+01:00 Roman Cheplyaka : > Hey Takenobu, great job! I especially liked the presence of references. > > On 31/12/14 17:40, Takenobu Tani wrote: >> Dear Haskellers, >> >> I love haskell. >> I'm studying and playing around with Haskell, GHC, STG, Cmm, asm... >> >> When I started studying them, I wanted some figures. >> I've not have some mental models because I am a hardware person. >> >> So I am drawing few illustrations for hardware persons. Here is: >> >> GHC(STG,Cmm,asm) illustrated for hardware persons >> http://takenobu-hs.github.io/downloads/haskell_ghc_illustrated.pdf >> https://github.com/takenobu-hs/haskell-ghc-illustrated >> >> If there are some misunderstandings or errors, please teach me. >> I'll correct or remove them. >> >> Thank you :-) >> >> >> I wish you a happy new year, >> Takenobu >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From jkarni at gmail.com Wed Dec 31 15:54:14 2014 From: jkarni at gmail.com (Julian Arni) Date: Wed, 31 Dec 2014 16:54:14 +0100 Subject: [Haskell-cafe] Type-directed functions In-Reply-To: References: Message-ID: Assuming you mean things like the 'Extend' type family, and 'extend' function, this illustrates one of the doubts I have. In particular, if I have a type family: data TypeA = TypeA type family TF where TF Bool = TypeA then I can write a corresponding function with signature Bool -> TF Bool (since there is only one case for the type family). But suppose I extend TF: data TypeB = TypeB type family TF where TF Bool = TypeA TF Char = TypeB Now, I want to write a function "transformTF :: a -> TF a", but 'a' should really just be restricted to those cases for which 'TF a' is defined. I can obviously do this with fundeps or ATPs (and a class constraint), but then I'm moving in the type-class direction, and, as far as I can tell, no longer benefit from having type families at all. I guess I could also explicitly pass dictionaries, but that seems even worse. I guess that's my basic question: can one write a function that, for a type family of arbitrary structure (possibly recursive or mutually recusrive, multiple cases) "implements" (i.e., has the corresponding signatures of) that type family? On Tue, Dec 30, 2014 at 6:47 PM, Atze van der Ploeg wrote: > Hi Julian, > > Check out my package ctrex. https://www.haskell.org/haskellwiki/CTRex > > Cheers, > > Atze > On Dec 30, 2014 6:20 PM, "Julian Arni" wrote: > >> Hi all, >> >> I've been playing around with what might be described as type-directed >> functions. One example is a list-like structure of phantom-typed values >> >> {-# LANGUAGE TypeOperators #-} >> {-# LANGUAGE DataKinds #-} >> {-# LANGUAGE PolyKinds #-} >> >> import GHC.TypeLits >> >> infixr 6 ::: >> data a ::: b = a ::: b >> deriving (Show, Eq) >> >> data Tag b = Tag String >> deriving (Show, Eq) >> >> ex1 :: Tag 5 ::: Tag 3 ::: Tag 7 >> ex1 = Tag "Alice" ::: Tag "Bob" ::: Tag "Carol" >> >> >> And then sorting 'ex1' based on the Nats, such that >> >> sort ex1 :: Tag 3 ::: Tag 5 ::: Tag 7 >> sort ex1 = Tag "Bob" ::: Tag "Alice" ::: Tag "Carol" >> >> Notice how it's the types, not the values, that determine the result, but >> that the value-level also changes. >> >> I know how to do this using classes, but it's a little excruciating - it's >> like programming in a verbose and very restricted Prolog. With type >> families >> it's much easier to get the result *type* (pattern matching is simple, >> recursive calls are natural, and it all looks a lot more like Haskell), >> but >> I haven't yet seen a way of effectively using type families to direct >> the value-level component of the calculation. >> >> Are there any examples of how this might be done? Or are there other >> alternatives to using type-classes that I am missing? Or, alternatively, >> are >> there libraries to reduce the boilerplate of this type-class code? >> >> Thanks, >> Julian >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From takenobu.hs at gmail.com Wed Dec 31 16:11:57 2014 From: takenobu.hs at gmail.com (Takenobu Tani) Date: Thu, 1 Jan 2015 01:11:57 +0900 Subject: [Haskell-cafe] GHC(STG, Cmm, asm) illustrated for hardware persons In-Reply-To: References: <54A41AFB.4000100@ro-che.info> Message-ID: Hi Roman, Vo, Thank you for your quick reply. I am encouraged by you:-) good night ;-) Takenobu 2015-01-01 0:50 GMT+09:00 Vo Minh Thu : > Indeed this is very nice. I posted it on reddit[0] where it might get > some feedback. > > [0] http://www.reddit.com/r/haskell/comments/2qxcmz/ghc_illustrated_pdf/ > > 2014-12-31 16:49 GMT+01:00 Roman Cheplyaka : > > Hey Takenobu, great job! I especially liked the presence of references. > > > > On 31/12/14 17:40, Takenobu Tani wrote: > >> Dear Haskellers, > >> > >> I love haskell. > >> I'm studying and playing around with Haskell, GHC, STG, Cmm, asm... > >> > >> When I started studying them, I wanted some figures. > >> I've not have some mental models because I am a hardware person. > >> > >> So I am drawing few illustrations for hardware persons. Here is: > >> > >> GHC(STG,Cmm,asm) illustrated for hardware persons > >> http://takenobu-hs.github.io/downloads/haskell_ghc_illustrated.pdf > >> https://github.com/takenobu-hs/haskell-ghc-illustrated > >> > >> If there are some misunderstandings or errors, please teach me. > >> I'll correct or remove them. > >> > >> Thank you :-) > >> > >> > >> I wish you a happy new year, > >> Takenobu > >> > >> > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> Haskell-Cafe at haskell.org > >> http://www.haskell.org/mailman/listinfo/haskell-cafe > >> > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fryguybob at gmail.com Wed Dec 31 16:15:58 2014 From: fryguybob at gmail.com (Ryan Yates) Date: Wed, 31 Dec 2014 11:15:58 -0500 Subject: [Haskell-cafe] GHC(STG, Cmm, asm) illustrated for hardware persons In-Reply-To: References: Message-ID: This is excellent! Thanks for making it all, it was clearly a lot of work. I will keep you work in mind when I need to explore more of GHC. On Wed, Dec 31, 2014 at 10:40 AM, Takenobu Tani wrote: > Dear Haskellers, > > I love haskell. > I'm studying and playing around with Haskell, GHC, STG, Cmm, asm... > > When I started studying them, I wanted some figures. > I've not have some mental models because I am a hardware person. > > So I am drawing few illustrations for hardware persons. Here is: > > GHC(STG,Cmm,asm) illustrated for hardware persons > http://takenobu-hs.github.io/downloads/haskell_ghc_illustrated.pdf > https://github.com/takenobu-hs/haskell-ghc-illustrated > > If there are some misunderstandings or errors, please teach me. > I'll correct or remove them. > > Thank you :-) > > > I wish you a happy new year, > Takenobu > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From f at mazzo.li Wed Dec 31 16:25:42 2014 From: f at mazzo.li (Francesco Mazzoli) Date: Wed, 31 Dec 2014 17:25:42 +0100 Subject: [Haskell-cafe] GHC(STG, Cmm, asm) illustrated for hardware persons In-Reply-To: References: Message-ID: Impressive work, thanks a lot! Francesco On 31 December 2014 at 17:15, Ryan Yates wrote: > This is excellent! Thanks for making it all, it was clearly a lot of work. > I will keep you work in mind when I need to explore more of GHC. > > On Wed, Dec 31, 2014 at 10:40 AM, Takenobu Tani > wrote: >> >> Dear Haskellers, >> >> I love haskell. >> I'm studying and playing around with Haskell, GHC, STG, Cmm, asm... >> >> When I started studying them, I wanted some figures. >> I've not have some mental models because I am a hardware person. >> >> So I am drawing few illustrations for hardware persons. Here is: >> >> GHC(STG,Cmm,asm) illustrated for hardware persons >> http://takenobu-hs.github.io/downloads/haskell_ghc_illustrated.pdf >> https://github.com/takenobu-hs/haskell-ghc-illustrated >> >> If there are some misunderstandings or errors, please teach me. >> I'll correct or remove them. >> >> Thank you :-) >> >> >> I wish you a happy new year, >> Takenobu >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From carter.schonwald at gmail.com Wed Dec 31 18:29:54 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 31 Dec 2014 13:29:54 -0500 Subject: [Haskell-cafe] GHC(STG, Cmm, asm) illustrated for hardware persons In-Reply-To: References: Message-ID: wow, this is a great slide deck, thank you for sharing. On Wed, Dec 31, 2014 at 11:25 AM, Francesco Mazzoli wrote: > Impressive work, thanks a lot! > > Francesco > > On 31 December 2014 at 17:15, Ryan Yates wrote: > > This is excellent! Thanks for making it all, it was clearly a lot of > work. > > I will keep you work in mind when I need to explore more of GHC. > > > > On Wed, Dec 31, 2014 at 10:40 AM, Takenobu Tani > > wrote: > >> > >> Dear Haskellers, > >> > >> I love haskell. > >> I'm studying and playing around with Haskell, GHC, STG, Cmm, asm... > >> > >> When I started studying them, I wanted some figures. > >> I've not have some mental models because I am a hardware person. > >> > >> So I am drawing few illustrations for hardware persons. Here is: > >> > >> GHC(STG,Cmm,asm) illustrated for hardware persons > >> http://takenobu-hs.github.io/downloads/haskell_ghc_illustrated.pdf > >> https://github.com/takenobu-hs/haskell-ghc-illustrated > >> > >> If there are some misunderstandings or errors, please teach me. > >> I'll correct or remove them. > >> > >> Thank you :-) > >> > >> > >> I wish you a happy new year, > >> Takenobu > >> > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> Haskell-Cafe at haskell.org > >> http://www.haskell.org/mailman/listinfo/haskell-cafe > >> > > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erkokl at gmail.com Wed Dec 31 18:35:23 2014 From: erkokl at gmail.com (Levent Erkok) Date: Wed, 31 Dec 2014 10:35:23 -0800 Subject: [Haskell-cafe] GHC(STG, Cmm, asm) illustrated for hardware persons In-Reply-To: References: Message-ID: What an impressive slide deck; a great new-year gift to the community Tani.. Thank you. This should be featured directly off of the Haskell wiki-page; or at least the GHC's top page; very useful. -Levent. On Wed, Dec 31, 2014 at 7:40 AM, Takenobu Tani wrote: > Dear Haskellers, > > I love haskell. > I'm studying and playing around with Haskell, GHC, STG, Cmm, asm... > > When I started studying them, I wanted some figures. > I've not have some mental models because I am a hardware person. > > So I am drawing few illustrations for hardware persons. Here is: > > GHC(STG,Cmm,asm) illustrated for hardware persons > http://takenobu-hs.github.io/downloads/haskell_ghc_illustrated.pdf > https://github.com/takenobu-hs/haskell-ghc-illustrated > > If there are some misunderstandings or errors, please teach me. > I'll correct or remove them. > > Thank you :-) > > > I wish you a happy new year, > Takenobu > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iustin at k1024.org Wed Dec 31 19:08:07 2014 From: iustin at k1024.org (Iustin Pop) Date: Wed, 31 Dec 2014 20:08:07 +0100 Subject: [Haskell-cafe] GHC(STG, Cmm, asm) illustrated for hardware persons In-Reply-To: References: Message-ID: <20141231190807.GD5496@teal.hq.k1024.org> On Thu, Jan 01, 2015 at 12:40:55AM +0900, Takenobu Tani wrote: > Dear Haskellers, > > I love haskell. > I'm studying and playing around with Haskell, GHC, STG, Cmm, asm... > > When I started studying them, I wanted some figures. > I've not have some mental models because I am a hardware person. > > So I am drawing few illustrations for hardware persons. Here is: > > GHC(STG,Cmm,asm) illustrated for hardware persons > http://takenobu-hs.github.io/downloads/haskell_ghc_illustrated.pdf > https://github.com/takenobu-hs/haskell-ghc-illustrated Excellent slides, thank you very much! Learned quite a few things, and will need to re-read them more in depth after a while :) Happy New Year to everyone, iustin From jtd at galois.com Wed Dec 31 22:49:20 2014 From: jtd at galois.com (Jonathan Daugherty) Date: Wed, 31 Dec 2014 14:49:20 -0800 Subject: [Haskell-cafe] HaskellNet: maintainer(s) needed! Message-ID: <20141231224920.GA43704@galois.com> Hi, TLDR: HaskellNet needs a new maintainer! I am the current maintainer of HaskellNet, a library for accessing POP, IMAP, and SMTP services. Because I do not have the time to be the kind of maintainer this library needs, I need help. If you use HaskellNet in production, care about providing this service to the community, and/or feel qualified to provide technical support for this library, please let me know! I am looking for someone interested enough to take ownership of this package. Other than that, some kinds of help desired include: - improve documentation - improve test suite - resolve GitHub support tickets - test on Windows https://github.com/jtdaugherty/HaskellNet http://hackage.haskell.org/package/HaskellNet Thanks, -- Jonathan Daugherty Software Engineer Galois, Inc.