News aggregator

why the minimal implementation of Ord is <= instead of <

Haskell on Reddit - Mon, 11/09/2015 - 6:31pm

Given that Ord is also Eq, isn't = given already?

submitted by mr_delphi
[link] [8 comments]
Categories: Incoming News

darcs 2.10.2 release

haskell-cafe - Mon, 11/09/2015 - 4:17pm
The darcs team is pleased to announce the release of darcs 2.10.2 ! # Downloading # The easiest way to install darcs 2.10.2 from source is by first installing the Haskell Platform ( If you have installed the Haskell Platform or cabal-install, you can install this release by doing: $ cabal update $ cabal install darcs-2.10.2 Alternatively, you can download the tarball from and build it by hand as explained in the README file. The 2.10 branch is also available as a darcs repository from # What's new in 2.10.2 (since 2.10.1) # * optimize patch apply code memory use * make patch selection lazier in presence of matchers * switch patches retrieval order when using packs * switch from dataenc (deprecated) to sandi * finish updating help strings with new command names * clean contrib scripts * disable mmap on Windows * enhance darcs send message * fix quickcheck suite * shorter README
Categories: Offsite Discussion

Beginner: Art in Haskell

Haskell on Reddit - Mon, 11/09/2015 - 2:47pm

I was wondering if anyone had any links or advice when it came to doing art in Haskell.

I'm quite new to Haskell but wanted to try out some graphics stuff (fractals, etc).

Where would be a good place to start? :)

submitted by Catamorpheus
[link] [12 comments]
Categories: Incoming News

minElem function int -> intger -> double

Haskell on Reddit - Mon, 11/09/2015 - 1:18pm

Hi, if i have a function that searches the minimum element in the list with Int, how can i use it with Intger and double?

thx 4 help

submitted by mohawke781
[link] [8 comments]
Categories: Incoming News

Leuven Haskell User Group: Season 2

General haskell list - Mon, 11/09/2015 - 1:07pm
Dear Haskellers, Season 2 of the Leuven Haskell User Group starts on November 17. Join us for an introductory talk on type classes. Everyone is welcome. For more information:!forum/leuven-haskell See you there!
Categories: Incoming News

Permutation differnce

Haskell on Reddit - Mon, 11/09/2015 - 12:59pm

Hi guys, can you help me finding the differnce between

import Data.List permHH [] = [[]] permHH [a] = [[a]] permHH as = [x:xs | x <- nub as, xs <- permHH (delete x as)]


permLL [] = [[]] permLL as = [as!!(i-1):xs | i <- [1..length as], xs <- permLL (take (i-1) as ++ drop i as)]

i get the same results for both functions, but there has to be a difference.

thx for helping

submitted by mohawke781
[link] [comment]
Categories: Incoming News

Does this happen to anyone else: I mention Haskell to somebody I meet, and they hear Pascal.

Haskell on Reddit - Mon, 11/09/2015 - 7:36am

So instead of revealing something somewhat novel and interesting, I reveal boring and antiquated until I can correct them.

submitted by zzing
[link] [146 comments]
Categories: Incoming News

Anybody using the "top-down" cabal-install solver?

haskell-cafe - Mon, 11/09/2015 - 7:18am
(Sorry if you get this twice, forgot to cross-post to -cafe initially.) Hi all, Just to get input from as many people as possible: I was pondering a plan for modularizing[2] the Cabal solver[1] and wanted to reach as many people as possible with my question: Is anybody is still using the top-down solver? Please respond to this list if you are, especially if you're doing so because there's no other way to get the modular solver to do what you want. (Obviously, I'm not promising to fix any problems you may have with the modular solver, but it would be valuable information since it could affect the decision of whether we have to keep the top-down solver around.) Regards, -- [1] [2] "Splitting it out into its own library" is perhaps a more accurate description, but somewhat unwieldly :).
Categories: Offsite Discussion

Eric Kidd: Bare Metal Rust: Low-level CPU I/O ports

Planet Haskell - Mon, 11/09/2015 - 6:33am

Want to build your own kernel in Rust? See the Bare Metal Rust page for more resources and more posts in this series.

Rust is a really fun language: It allows me to work on low-level kernel code, but it also allows me to wrap my code up in clean, high-level APIs. If you this sounds interesting, you should really check out Philipp Oppermann's blog posts about writing a basic x86_64 operating system kernel in Rust. He walks you through booting the kernel, entering long mode, getting Rust running, and printing text to the screen.

Once you get a basic kernel running, you'll probably want to start working on basic I/O, which requires interrupts. And this point, you'll find that pretty much every tutorial dives right into the in and out instructions. For example, if you look at the introduction to interrupts, the very first code you'll see is (comments added):

mov al,20h ; Move interrupt acknowledgment code into al. out 20h,al ; Write al to PIC on port 0x20.

Here, we're talking to the PIC ("Programmable Interrupt Controller"), and we're telling it that we've finished handling a processor interrupt. To do this, we need to write an 8-bit status code to the I/O port at address 0x20.

Traditionally, we would wrap this up in an outb ("out byte") function, which might look something like this in Rust:

// The asm! macro requires a nightly build of Rust, and // we need to opt-in explicitly. #![feature(asm)] unsafe fn outb(value: u8, port: u16) { asm!("outb %al, %dx" :: "{dx}"(port), "{al}"(value) :: "volatile"); }

This writes an 8-byte value to the specified port. It uses the unstable Rust extension asm!, which allows us to use GCC/LLVM-style inline assembly. We'd invoke it like this:

outb(0x20, 0x20);

But let's see if we can wrap a higher-level API around an I/O port.

Read more…

Categories: Offsite Blogs

Is there any Haskell non-open source library?

Haskell on Reddit - Mon, 11/09/2015 - 4:07am

I wonder if it is possible at all? I know that compiled binaries are not compatible across different versions of GHC. But even sticking to the same version of GHC, I realized that cabal sandboxes cannot be moved to a different path.

submitted by gtab62
[link] [9 comments]
Categories: Incoming News

How to get GHC to produce ADC instructions for longaddition

haskell-cafe - Mon, 11/09/2015 - 2:41am
Here is some code that adds two 192 bit numbers, represented as three 64bit machine words (well, on my machine anyway), and returns the result and any carry: {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} import GHC.Prim( plusWord2#, Word#, or#) longAdd :: (# Word#, Word#, Word# #) -> (# Word#, Word#, Word# #) -> (# Word#, (# Word#, Word#, Word# #) #) longAdd (# xl, xm, xh #) (# yl, ym, yh #) = let plusWord2WithCarry x y c = let (# c1, r1 #) = plusWord2# x y (# c2, r2 #) = plusWord2# r1 c in (# plusWord# c1 c2, r2 #) (# cl, rl #) = plusWord2# xl yl (# cm, rm #) = plusWord2WithCarry xm ym cl (# ch, rh #) = plusWord2WithCarry xh yh cm in (# ch, (# rl, rm, rh #) #) (My code covers words other than size 3 btw) I'd like this to compile into something like: add x1 y1 adc x2 y2 adc x3 y3 Unfortunately, I think my problem is with the "plusWord2WithCarry". As there's no primitive operation in Haskell which adds two words and a carry. What seems to happen when I look at the generated assembly is the fo
Categories: Offsite Discussion

Oppa Lambda Style

Haskell on Reddit - Sun, 11/08/2015 - 10:02pm
Categories: Incoming News

Creating Haskell Pattern Matching for Javascript

Haskell on Reddit - Sun, 11/08/2015 - 9:44pm

Hi, I code Haskell for love, and JavaScript for home!

Javascript has functional libraries, such as Ramda, that's make JS "more functional", however I'm still missing the power of pattern matching as in Haskell.

There's 2 JS libraries that make pattern matching: one creates by string (like "x:xs"..seriously!), other via macros (need to install some stuff in JS that changes synthax, crazy!)

So I did a natural way to create patterns like Haskell in Javascript: Z: Native Pattern Matching for JavaScript!. I'm pretty excited with results, seems to be very close to haskell! I want some opinions, since I'm not Haskell expert

There's some code examples at:


submitted by tumeni
[link] [39 comments]
Categories: Incoming News

In haskell, email and username

Haskell on Reddit - Sun, 11/08/2015 - 8:01pm

I need to Write a recursive function getUserName that takes an email address and returns words (before the @).

How can I do it ?

Can anyone explain that ?

I need to know step by step please

submitted by Germany22221
[link] [13 comments]
Categories: Incoming News

In haskell, Discount percent

Haskell on Reddit - Sun, 11/08/2015 - 1:00pm
totalDiscount :: Int -> Int -> Float totalDiscount x y = 100 * (a / b) where a = fromIntegral x :: Float b = fromIntegral y :: Float

I tried that code but gave me errors

such as

<interactive>:4:19: Couldn't match expected type `Int' with actual type `[Integer]' In the second argument of `totalDiscount', namely `[4, 5]' In the expression: totalDiscount 0.1 [4, 5] In an equation for `it': it = totalDiscount 0.1 [4, 5]

how can I do that ?

submitted by Germany22221
[link] [23 comments]
Categories: Incoming News

Full-time Haskell job at Grasswire (VC-backed startup)

Haskell on Reddit - Sun, 11/08/2015 - 10:16am

EDIT: we're looking for candidates who are roughly in GMT -08:00 to -05:00

Hey all. I'm CTO and co-founder of Grasswire (@grasswire on Twitter). We're a venture-backed startup and our current product is a crowdsourced news service (something like Wikipedia for the news). We bring people together to find and publish breaking news.

We are a distributed team, currently six full-time people in five different states and we're looking to add an experienced Haskell programmer to our team. The ideal candidate is someone with solid Haskell experience and excellent communication skills. Big plus if you like to get involved on the product side and can contribute on that front. Since we're distributed and also a pretty early-stage company, we look for people who can hit the ground running and don't require any babysitting.

We're beginning development of a new, but related product which focuses on the more social aspects of what we currently do. This is a greenfield project and all development will be in Haskell.

You'll be writing APIs and web apps. The APIs will have real-time components, using things like WebSockets. We've started early prototyping using Yesod, but you will have ownership of the decision of which frameworks/tools to use; you should just be able to justify your decisions.

While we do have some experience with Haskell - we currently have a small, but critical web service in production that's written in Haskell - we're looking for someone who can help newcomers get started so excellent communication is a must.

We're a pretty flat organization. We like to have everyone involved in product conversations. We usually have a brief conference call once or twice a day to discuss what we're working on, assess whether we're working on the right things, and figure out what to work on next. We like to deploy small changes frequently; we deploy to production multiple times a day.

Salary is competitive and we'll get you whatever hardware/software you think you need. If you're interested in discussing in more detail, I'd love to chat. You can DM me on Twitter @LeviNotik or email me at levi at grasswire dot com.

EDIT: Candidates in GMT ~ -08:00 to -05:00


submitted by LuxuryMode
[link] [9 comments]
Categories: Incoming News

Prelude's `lines` is not bijective :(

Haskell on Reddit - Sun, 11/08/2015 - 7:14am
Prelude> lines "bar\nfoo\n" == lines "bar\nfoo" True

Add to the list of things I wish I knew before doing text processing in Haskell. You need to take this corner case into account when used in conjunction with unlines, otherwise you lose data.

The relevant hackage Documentation should at least warn about it, IMHO. Same thing with Data.Text.{un,}lines, there it should hint at splitOn "\n", which is reversible.

submitted by da-x
[link] [24 comments]
Categories: Incoming News