News aggregator

Call for concurrency bugs!

haskell-cafe - Fri, 05/15/2015 - 2:14pm
Hi cafe, I've been working on a little library for testing concurrent Haskell programs, and would really like some test cases not constructed by myself to throw it at. If anyone has any examples of buggy concurrency (preferably where it's tricky to provoke the bugs with conventional testing techniques) that I could use: either open bugs, or things which have been fixed but were awkward to do so, that would be really useful. This is leading up to a paper, hopefully, so examples may go into that: anonymously, if preferred. Thank you. -- Michael Walker (http://www.barrucadu.co.uk) _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Haskell Weekly News

General haskell list - Fri, 05/15/2015 - 1:07pm
*Top Picks:* - Is Servant <http://haskell-servant.github.io/>the most type-safe HTTP server library ever? Are the type signatures hard to read <https://news.ycombinator.com/item?id=9519782#up_9520750>? In addition to its utmost relevance as a web library, Servant is also an awesome case study in the type safety vs type readability trade-off spectrum, brought to you by Alp Mestanogullari and Julian Arni. HN <https://news.ycombinator.com/item?id=9519782> and /r/haskell <http://www.reddit.com/r/haskell/comments/35hiie/servant_04_released/> - Ozan Sener compiles Pandoc into JS via GHCJS and creates a web interface to it using the Reflex FRP library <https://github.com/ryantrinkle/reflex>. Markup.Rocks <https://github.com/osener/markup.rocks> is much loved on /r/haskell <http://www.reddit.com/r/haskell/comments/35ax22/ive_compiled_pandoc_with_ghcjs_and_built_an/>. See also HN <https://news.ycombinator.com/item?id=9512293>. - Is Haskell a "Startup Secret Weapon"? Ale
Categories: Incoming News

Parametricity and the difference between <*> and >>=

Haskell on Reddit - Fri, 05/15/2015 - 12:27pm

Can parametricity be used to explain the difference between (<*>) :: f (a -> b) -> f a -> f b and (>>=) :: m a -> (a -> m b) -> m b? More concretely, can it be proven that the function in f (a -> b) is always independent of the other term, while the lifted function (a -> m b) can always depend on the other term?

I want to use this to say something about the context-free-ishness of applicative parser combinators, and why it's so hard to optimize the grammar of a monadic parser combinator.

submitted by vincentrevelations
[link] [5 comments]
Categories: Incoming News

cabal is giving a weird error when attempting to install pandoc on Ubuntu 14.04

Haskell on Reddit - Fri, 05/15/2015 - 12:24pm

Hi. I am attempting to install Hakyll on my Chromebook's Ubuntu 14.04 chroot and I keep running into issues. I also ran into this problem when attempting to install on my 14.04 DigitalOcean droplet, but did not have this issue on my Manjaro install on my big PC.

My order of operations was to apt-get install haskell-platform and then cabal update and cabal install hakyll. The last command has a lot of dependencies that it attempts to install and it does work successfully, but when it gets to pandoc I get this error:

$ cabal install hakyll Resolving dependencies... [1 of 1] Compiling Main ( /tmp/pandoc-1.13.2.1-12343/pandoc-1.13.2.1/Setup.hs, /tmp/pandoc-1.13.2.1-12343/pandoc-1.13.2.1/dist/setup/Main.o ) Linking /tmp/pandoc-1.13.2.1-12343/pandoc-1.13.2.1/dist/setup/setup ... /usr/lib/ghc/unix-2.6.0.1/libHSunix-2.6.0.1.a(execvpe.o): In function `pPrPr_disableITimers': (.text+0x300): multiple definition of `pPrPr_disableITimers' /root/.cabal/lib/unix-2.7.1.0/ghc-7.6.3/libHSunix-2.7.1.0.a(ghcrts.o):ghcrts.c:(.text+0x0): first defined here collect2: error: ld returned 1 exit status Failed to install pandoc-1.13.2.1 cabal: Error: some packages failed to install: hakyll-4.6.9.0 depends on pandoc-1.13.2.1 which failed to install. pandoc-1.13.2.1 failed during the configure step. The exception was: ExitFailure 1 pandoc-citeproc-0.7.1 depends on pandoc-1.13.2.1 which failed to install.

This error seems to be similar to the error in this post, but I am not really sure how to fix it. I am still getting my feet wet with Haskell in general and this is my first time using cabal to install anything (and use anything outside of the default packages).

I would appreciate it if someone could guide me on how to resolve this error. Thanks in advance.

EDIT: So I gave up on trying to fiddle around with the haskell-platform and ghc 7.6.* and whatever version of cabal that it comes with. I found this Gist describing how to install ghc 7.10.1 and cabal 1.22.3.0 from source. I followed the instructions (just ran all the commands in order) and they worked on Ubuntu 14.04 perfectly.

EDIT 2: So because this whole compilation/installation process required over 1 GB of RAM, to get this running on my DigitalOcean droplet I had to shut it down and scale it up from 500 MB to 2 GB. When the process was done I scaled it back down and it appears that doing so broke ghc (I tested it right before and right after scaling it back down). I assume it will still work on my Chromebook, so I am fine if that is the case.

submitted by AIDS_Pizza
[link] [6 comments]
Categories: Incoming News

Can I specify the a in a phantom type to be limitedto a sum type?

haskell-cafe - Fri, 05/15/2015 - 7:47am
How can I create Answers of type Gender, Race, or Age? These should be possible: λ> Answer Male λ> Answer White λ> Answer Black λ> Answer 28 Others such as using a string should not be possible: λ> Answer "a string" -- should throw type error {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE StandaloneDeriving #-} module Tutorial where data Gender = Male | Female deriving (Show) data Race = White | Black deriving (Show) type Age = Int data Answer a where Answer :: Gender -> Answer Gender deriving instance Show (Answer w)
Categories: Offsite Discussion

Equality Contstraint?

haskell-cafe - Fri, 05/15/2015 - 2:17am
I am poking around in Arrow to understand it better. There is the following definition: second :: a b c -> a (d,b) (d,c) second f = arr swap >>> first f >>> arr swap where swap :: (x,y) -> (y,x) swap ~(x,y) = (y,x) Can someone explain what the ~ is? Searching the net resulted in frustration. I kind of think it is some kind of equality constraint but can’t find documentation. Perhaps if I knew what it was called I might succeed in finding something. If it is an equality constraint, please provide a reference if you have one. I did not find anything in a search including GHC, etc. Thanks
Categories: Offsite Discussion

Comparing Functions for Equality?

Haskell on Reddit - Thu, 05/14/2015 - 8:20pm

I read in A Book of Abstract Algebra, by Prof. Charles Pinter, that:

If f and g are functions from Real to Real, then f and g are equal if and only if f(x) = g(x) for every real number x.

When I tried to compare functions in ghci, I saw this compile-time error:

Prelude> let f x = "foo" Prelude> let g x = "foo" Prelude> f == g <interactive>:7:3: No instance for (Eq (t0 -> [Char])) arising from a use of `==' In the expression: f == g In an equation for `it': it = f == g

Is it simply too much work, not possible, to compare every input for the compiler? Or it's out of the compiler's scope?

submitted by kevin_meredith
[link] [19 comments]
Categories: Incoming News

Data constructor ‘Minus’ comes from an un-promotable type ‘Ints’

haskell-cafe - Thu, 05/14/2015 - 5:36pm
Hello, I clearly don’t really know what I’m doing…but at least I know it…. Here we defined the Naturals…and then attempt to construct the Integers…. naturals I can now define + and * and prove things about them…1 * x == x etc….nice..but lets put that on one side. Borrow bits and bobs from singletons Borrow bits and bobs from singletons..i.e. the isomorphic values…my proofs in nat now map to SNat…double nice. Create the integers by following my nose……(the integers are the equivalence class of pairs of naturals….) i.e. we have “positive” or “negative” or “zero”… Ok….this works as a set of values….but…. I can’t prove anything about these because the data constructors for my integers aren’t “promotable”…..so I cant do the same trick I did with Nat. “:k Zero” ….. Data constructor ‘Zero’ comes from an un-promotable type ‘Ints’ In a type in a GHCi command: Zero I’ve tried rejigging this in various futile and ignorant m
Categories: Offsite Discussion

CFP : Extended deadline : Functional Art, Music,Modelling and Design (FARM 2015)

General haskell list - Thu, 05/14/2015 - 11:12am
************************************************************ Call for Papers and Demos : FARM 2015 The 3rd ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design Vancouver, Canada, 5 September, 2015 affiliated with ICFP 2015 http://functional-art.org EXTENTED Submission Deadline : 27 May, 2015 (optional abstract submission : 17 May, 2015) ************************************************************ The ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design (FARM) gathers together people who are harnessing functional techniques in the pursuit of creativity and expression. Functional Programming has emerged as a mainstream software development paradigm, and its artistic and creative use is booming. A growing number of software toolkits, frameworks and environments for art, music and design now employ functional programming languages and techniques. FARM is a forum for expl
Categories: Incoming News

Suggestion: "Sizable" super class for Storable

haskell-cafe - Thu, 05/14/2015 - 9:50am
Storable instances have a size, given by sizeOf. In many cases, we're not interested in peeking/poking data but only passing it opaquely via the FFI. A common use case is when the C API offers an "init" function such as: void mycontext_init(mycontext *context); For these cases it would be useful to know the size of "mycontext", so we could malloc it and pass a pointer to mycontext_init. Also, it allows Haskell-side code to decide how it wants to allocate the data, perhaps using some other (external) mechanism not related to the specific API that the FFI bindings are wrapping. c2hs would benefit by allowing users to use the '+' notation in function parameters (which generate malloc-and-pass style code), without having to guess the size of the structure. Instead, it could simply use the Sizable (TM) instance to get the size, and the user will define Sizable in any way they want (for example, using the {#sizeof#} macro, which is somewhat unreliable, or by hard-coding or manually entering the size or b
Categories: Offsite Discussion

maintaining pre-AMP+FTP-Prelude in external package

libraries list - Wed, 05/13/2015 - 12:50pm
The Prelude of GHC-7.10/base-4.8 introduces several name clashes mostly due to the AMP and FTP: (<*) clashes with Accelerate, (<*>) clashes with NumericPrelude, (and (<>) would clash with HMatrix if added to Prelude), 'join', 'pure', 'traverse', 'fold' clash with custom defined functions. "import Prelude hiding (pure)" is not yet supported by GHC-7.4 (as shipped with Ubuntu 12.04) and in newer GHC versions it generates an annoying warning. The only remaining option is to explicitly import identifiers from Prelude. What about maintaining the pre-AMP+FTP-Prelude in a package on Hackage? Then we could maintain compatibility with a range of GHC versions by disabling import of Prelude and importing preamplified (so to speak) Prelude. The base-compat package seems to support the other way round, that is, providing new 'base' functions to old compilers.
Categories: Offsite Discussion

Fedora ghc-7.10.1 repo

glasgow-user - Wed, 05/13/2015 - 4:28am
Hi, It is a bit later than I wanted but I have prepared a Fedora Copr repo for ghc-7.10.1. https://copr.fedoraproject.org/coprs/petersen/ghc-7.10.1/ (note the EPEL7 and F20 builds are currently quick builds and the F21+ builds are perf builds) I will probably add a cabal-install build soon. Let me know if you find any problems or if it is useful. :) Jens
Categories: Offsite Discussion

Proposal: Generalize forever to Applicative

libraries list - Tue, 05/12/2015 - 6:05am
This looks like a no-brainer to me: forever :: Applicative f => f a -> f b forever a = let x = a *> x in x _______________________________________________ Libraries mailing list Libraries< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Categories: Offsite Discussion

mapM /= traverse?

libraries list - Mon, 05/11/2015 - 8:15pm
I was hoping that in GHC 7.10 we would make mapM = traverse for lists, but it appears this isn't the case: the Traversable instance for lists overrides mapM to be the manually-defined version in terms of foldr. Why is this? Fusion? Unfortunately since I want mapM = traverse (for Haxl) I'll need to continue to redefine it in our custom Prelude. Cheers, Simon
Categories: Offsite Discussion

RFC: "Native -XCPP" Proposal

glasgow-user - Wed, 05/06/2015 - 12:08pm
Hello *, As you may be aware, GHC's `{-# LANGUAGE CPP #-}` language extension currently relies on the system's C-compiler bundled `cpp` program to provide a "traditional mode" c-preprocessor. This has caused several problems in the past, since parsing Haskell code with a preprocessor mode designed for use with C's tokenizer has caused already quite some problems[1] in the past. I'd like to see GHC 7.12 adopt an implemntation of `-XCPP` that does not rely on the shaky system-`cpp` foundation. To this end I've created a wiki page https://ghc.haskell.org/trac/ghc/wiki/Proposal/NativeCpp to describe the actual problems in more detail, and a couple of possible ways forward. Ideally, we'd simply integrate `cpphs` into GHC (i.e. "plan 2"). However, due to `cpp`s non-BSD3 license this should be discussed and debated since affects the overall-license of the GHC code-base, which may or may not be a problem to GHC's user-base (and that's what I hope this discussion will help to find out). So please go ahead and
Categories: Offsite Discussion

Looking for retainers of PINNED objects

glasgow-user - Wed, 04/29/2015 - 5:37am
Hi all, I'm profiling a fairly large program which seems to have a space leak. The heap profiling (-hc) shows that PINNED objects are accumulated over time. In order to check the retainers of the objects, I ran the retainer profiling. Unfortunately it didn't output anything with -hr -hcPINNED. Also, this is just a guess though, the retainer profiling without any filters (I mean just -hr) doesn't seem to include PINNED objects at all. Is there a way to check what retains the PINNED objects? Thanks, Mitsutoshi _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
Categories: Offsite Discussion

SIMD

glasgow-user - Sat, 04/11/2015 - 5:44pm
What’s the story with this? I tried to follow the instructions here: https://ghc.haskell.org/trac/ghc/wiki/SIMD <https://ghc.haskell.org/trac/ghc/wiki/SIMD> but I get Dominic Steinitz dominic< at >steinitz.org http://idontgetoutmuch.wordpress.com _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
Categories: Offsite Discussion

New gtk2hs 0.12.4 release

gtk2hs - Wed, 11/21/2012 - 12:56pm

Thanks to John Lato and Duncan Coutts for the latest bugfix release! The latest packages should be buildable on GHC 7.6, and the cairo package should behave a bit nicer in ghci on Windows. Thanks to all!

~d

Categories: Incoming News