Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [haskell]

This challenge is related to the Haskell language. Note that challenges that require the answers to be in a specific language are generally discouraged.

Filter by
Sorted by
Tagged with
1 vote
1 answer
251 views

I have the following Haskell code to generate the the values of the Fibonacci sequence which are even as an infinite list: ...
Wheat Wizard's user avatar
  • 103k
11 votes
2 answers
928 views

Curry is the Language of the Month this month and some users are starting to get into it, so let's get some tips together. Haskell and Curry are similar in a lot of ways and a lot of tips for Haskell ...
Wheat Wizard's user avatar
  • 103k
18 votes
1 answer
1k views

I'm trying to make a pointfree function f that can act like APL's dyadic forks/Husk's §, so ...
user's user avatar
  • 457
17 votes
3 answers
782 views

I tested the waters on this sort of question with python, but now I get to the real question I want to ask. restricted-source challenges are uniquely rewarding in Haskell because of Haskell's strict ...
Wheat Wizard's user avatar
  • 103k
8 votes
2 answers
363 views

Every so often I have a function of type a -> b and a function of type b -> b -> c and I would like a function of type <...
Wheat Wizard's user avatar
  • 103k
5 votes
2 answers
1k views

This challenge is about Haskell point-free style polynomial functions. Although you don't need to know Haskell language to do this challenge, Haskellers might have an advantage here. Point-free ...
Damien's user avatar
  • 2,467
3 votes
1 answer
254 views

GHC command line errors can be horrible, lets make them as bad as possible. To disincentivize very long programs use the following formula to calculate your "score". ...
Kyle McKean's user avatar
10 votes
3 answers
708 views

A little known fact is that if you turn on enough language extensions (ghc) Haskell becomes a dynamically typed interpreted language! For example the following program implements addition. ...
Wheat Wizard's user avatar
  • 103k
46 votes
34 answers
16k views

Recently I had the pleasure of writing a Haskell program that could detect if the NegativeLiterals extension was engaged. I came up with the following: ...
Wheat Wizard's user avatar
  • 103k
18 votes
4 answers
1k views

What is the shortest way we can express the function f(a,b)(c,d)=(a+c,b+d) in point-free notation? pointfree.io gives us ...
Wheat Wizard's user avatar
  • 103k
21 votes
12 answers
4k views

Haskell has tuples that can be written as (a,b,c) However this is just syntactic sugar for (,,)a b c In general an n tuple ...
Wheat Wizard's user avatar
  • 103k
-6 votes
5 answers
688 views

Your task will be to write a Haskell function that takes a list of integers and returns a sorted version of the same list. You are to do this without the use of builtins. What are builtins? To keep ...
Wheat Wizard's user avatar
  • 103k
62 votes
85 answers
11k views

In Haskell the list notation: [a,b,c] Is just syntactic sugar for: a:b:c:[] And the string notation: ...
Wheat Wizard's user avatar
  • 103k
8 votes
6 answers
2k views

Background (F#) Let there be trees: type Tree<'T> = Node of 'T * Tree<'T> list Now lets fold them nicely with a function called... ...
Good Night Nerd Pride's user avatar
9 votes
5 answers
437 views

The Haskell function biSp has type signature ...
dspyz's user avatar
  • 943
3 votes
1 answer
346 views

You need to implement immutable dictionaries using only functions without any other data types (custom or built-in). The dictionary must be indexed by any data type of class Eq and contain values of ...
Curly Brace's user avatar
21 votes
3 answers
3k views

I got the following question at a test: Write a function f with the following type a -> b -> (a -> b). ...
Radu Stoenescu's user avatar
88 votes
58 answers
19k views

What general tips do you have for golfing in Haskell? I am looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Haskell. Please post only one ...
Animesh 'the CODER''s user avatar
11 votes
2 answers
608 views

Often a task requires real arrays. Take for instance the task to implement Befunge or ><>. I tried to use the Array module for this, but it's really cumbersome, ...
FUZxxl's user avatar
  • 10.2k