Relative Content

Tag Archive for haskell

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 […]

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:

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.

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:

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.