New answers tagged

1

There are many reasonable approaches, but one is an adjacency list representation. You can use any convenient data structure for the adjacency list; I anticipate that a dictionary (ordered map) will be useful.


3

Monads in Haskell serve two purposes. A monad that is defined within Haskell is really a simulation of some computational effect in terms of pure (side-effect free) computation. After all, Haskell is a pure language. The second use of monads in Haskell, as well as in programming language semantics, and many other languages, is to model external or primitive ...


3

From a practical point of view, how do functional languages with formally specified semantics (like ML) handle side effects like printing? I'm aware of things like the IO monad in Haskell but I'm interested in how the actual primitives are encoded and implemented. It is strange to lump ML and Haskell together in this question. Unlike Haskell, ML is not a ...


Top 50 recent answers are included