How to access an external package in a file [duplicate]
This question already has answers here: VS Code “Could not find module” in standalone Haskell file (2 answers) Closed 2 days ago. I came across the youtube video for accessing external package by specifying in .cabal in a project. But how to access the package in a single file. Suppose I want to write a […]
How do you encode Algebraic Data Types in a C#- or Java-like language?
There are some problems which are easily solved by Algebraic Data Types, for example a List type can be very succinctly expressed as:
Different ways to see a monad
While learning Haskell I have faced a lot of tutorials trying to explain what are monads and why monads are important in Haskell. Each of them used analogies so it would be easier to catch the meaning.
At the end of the day, I have end up with 3 differents view of what a monad is:
Critique of the IO monad being viewed as a state monad operating on the world
The IO
monad in Haskell is often explained as a state monad where the state is the world. So a value of type IO a
monad is viewed as something like worldState -> (a, worldState)
.
Why is the concept of lazy evaluation useful?
It seems lazy evaluation of expressions can cause a programmer to lose control over the order in which their code is executed. I am having trouble understanding why this would be acceptable or desired by a programmer.
What’s the progress on Haskell records?
Recently I stumbled once again on the issues of Haskell’s records, in particular the uniqueness of field names. (It’s a pain…)
FP for simulation and modelling
I’m about to start a simulation/modelling project. I already know that OOP is used for this kind of projects. However, studying Haskell made me consider using the FP paradigm for modelling a system of components. Let me elaborate:
Why isn’t functional language syntax more close to human language?
I’m interested in functional programming and decided to get head to head with Haskell. My head hurts… but I’ll eventually get it…
I have one curiosity though, why is the syntax so cryptic (in lack of another word)?
How often is seq used in Haskell production code?
I have some experience writing small tools in Haskell and I find it very intuitive to use, especially for writing filters (using interact
) that process their standard input and pipe it to standard output.
Is Haskell’s type system formally equivalent to Java’s? [closed]
Closed 9 years ago.