Haskell (Programming Language)

Why does my implementation of Haskell snd not compile in Scala?

I defined the following function along the lines of Haskell sndTrying to use it with a List[ListNode[T]] doesn't compile. Why not?where:Error:

Programming

Typed Tagless Final Interpreters: what is the use of duplicate?

This question is related to the paper Typed Tagless Final Interpreters. In page 11, a function trice is presented, which relies on a duplicate …

Electric Vehicles

Returning a subset of types in Haskell

I'm trying to restrict the return type of a function to a subset of (kind) constructors. I can use typeclasses to restrict the input types, but when …

Programming

Why My Haskell Code is so slow compare to Swift and C

Here is very simple Haskell code to find all the Pythagoras integers from 1 to 200 that satisfied the Pythagoras Theorem X^2 = Y^2 + Z^2Haskell:It …

Programming

How to separate lines of a LaTeX eqnarray in Haddock markup?

I can't seem to get this simple LaTeX code, embedded in a Haskell comment, to render properly when run through Haddock with HTML target:When I run …

Equations

Are there any compile to Haskell languages? [on hold]

Has anyone attempted to build a new frontend for Haskell with Java like syntax? Or any other syntax?

Programming

Idiomatic Scala solution for the Dutch national flag problеm

I'm solving the Dutch national flag problem in Scala, and came up with the following code:For performance reasons, I want to modify the existing …

Programming

How to use the Haskell program, can I develop java code on a Haskell project? [on hold]

Recently I have done some research on my area, however, I found a project I need is written in the Haskell language.I have tried to compile this …

Programming

Haskell explicit recursion vs `iterate`

While writing a function using iterate in Haskell, I found that an equivalent version with explicit recursion seemed noticeably faster - even though …

Programming

Is there a way to install an Haskell executable as a dependency?

I found myself writing Haskell commands based upon other commands provided by other Haskell packages, but i could not find a way to install an …

Programming

Haskell's mapM when there are 3 monadic results

Now and again I keep running into Haskell code where I feel like I should be able to use mapM to make operating over the monads cleaner, but if I …

Programming

Probabilistic Functional Programming

Posted on July 17, 2018<p>Tags: Haskell, Probability<p>Here are the slides for a short talk I gave to a reading group I’m in at Harvard today. The speaker …

Functional Programming

Why is colon right associative in this expression?

Because function application is left associative in Haskell, I expectto be equivalent to ('x':'y'):"z". ('x':'y') is an error, because 'y' is not a …

Programming

Defining new types in Haskell - RPS game

I'm completely new to Haskell (and more generally to functional programming), so forgive me if this is really basic stuff. I'm reading Real World …

Programming

Why do we need IO?

In "Tackling the Awkward Squad: monadic input/output, concurrency, exceptions, and foreign language calls in Haskell", SPJ states"Perhaps the …

Programming

Why isn't GHCi letting me annotate my types with kinds?

I found out about Kinds while reading a History of Haskell paper and tried to run some of the examples at the Haskell Wiki.When I do, I get the …

Programming

bind can be composed of fmap and join, so do we have to use the monadic function a -> m a?

I don't use Haskell a lot, but I understand the concept of Monads.<p>I had been confused by Kleisli triple, and the category, however,<p>fmap and …

Programming

Is it possible to build a Restful API in Haskell without using Reader/Writer/State Monad or Monad Transformer

As a beginner, I feel Reader/Write/State Monad is difficult to understand. And Monad Transformers is even more difficult. I don't see the usage of …

Programming

How to disable the > exception when compiling Haskell with GHC?

If my program reaches an infinite loop, I would like it to actually get stuck: run forever, run out of memory or crash with a stack overflow.I don't …

Programming

Haskell readLn :: IO [on hold]

Ive been working through 'A Gentle Introduction to Haskell' but it doesnt have everything I'm looking for right now to learn. Im curious on how to …

Programming

Disable SSL certificate validation in Haskell `req` library

How to disable SSL certificate validation when using the Haskell req library? Similar to curl -k.

SSL

How to include a dependency C library in Haskell Stack

I want to create a Haskell Stack package that includes another Haskell Stack package as an extra-dep. The problematic thing is that the package that …

Programming

Different programming languages in one program [on hold]

I am currently looking for some ideas for the project that I have to work on this summer. I have to create a program using 3 different languages …

Programming

Haskell for Imperative Programmers [on hold]

I've been using imperative languages for 20 years now :)I'm a beginner in haskell and I love the paradigm shift you feel when you come from …

Programming

anansi: a NoWeb-inspired literate programming preprocessor

Anansi is a preprocessor for literate programs, in the model of NoWeb or nuweb. Literate programming allows both computer code and documentation to …

Programming

Haskell . Why does my parser fail

As as exercise of the Haskell Book written by bitemyapp I need to make a parser which can parse the given log. So I made this : …

Programming

Remembering old data

Remembering your first time (in a Haskell loop)I am trying to teach myself a little Haskell by going through some Hackerrank questions.The question I …

Programming

The Data Model Haskell Uses for Nested Types

A Haskell Nested Type might look like this:<p>I'm wondering what the data model is for this under the hood. That is, in JSON I would think it's along …

Data Modeling

get RequestBody in httpclient

I want to use Haskell send request to Amazon hosted elasticsearch server either using bloodhound or REST api directly.Since the server has IAM based …

REST API

Where can I find Haskell exercise? [on hold]

I'm a new Haskell learner. Haskell is a functional language and it is very different from the language like Python, Java I learned before. I want to …

Programming