Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
danidiaz
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
30 ms
·
241.
▲
by
danidiaz
12y ago
> Imagine every IO action having its own error type in a sum type. How do you compose them? Perhaps by converting each error type to a common sum type. Something like "Either (Either error1 error2) result". Typeclasses like &qu
242.
▲
by
danidiaz
12y ago
I think Haskell is a possible alternative to Go/Python/Ruby for these kinds of tasks. But nothing's perfect. Some possible annoyances you might encounter: * Much of the functionality required to be a valid "Python altern
243.
▲
by
danidiaz
12y ago
Seems related to the Rule of Least Power: http://en.wikipedia.org/wiki/Rule_of_least_power , http://c2.com/cgi/wiki?PrincipleOfLeastPower
244.
▲
by
danidiaz
12y ago
Reminds me of a strange story by Philip K. Dick titled "Null-O". The protagonists of that story are complete (and militant) mereological nihilists.
245.
▲
by
danidiaz
12y ago
"Parallel and Concurrent Programming in Haskell" by Simon Marlow is a great resource: http://chimera.labs.oreilly.com/books/1230000000929
246.
▲
by
danidiaz
12y ago
I believe HXT uses the default representation of strings as lists of chars, instead of more efficient packed representations. This likely contributes to the excessive memory usage.
247.
▲
by
danidiaz
12y ago
Max Planck said something similar about new theories in physics.
248.
▲
by
danidiaz
12y ago
You mean the "pipes" library? I have a bunch of helper functions for pipes & process here: http://hackage.haskell.org/package/process-streaming
249.
▲
by
danidiaz
12y ago
I once wrote a Haskell library for Java Swing application automation. I thought of calling it HSwing, but to my surprise (and, eventually, horror) the domain was already taken.
250.
▲
by
danidiaz
12y ago
In Haskell, iteratees have given way to coroutine-based approaches like conduits and pipes that let you program in a more natural manner.
251.
▲
by
danidiaz
13y ago
Come to think of it, Maven maps plugin goals to execution phases in a "monoidal" way. Each plugin has a number of goals, and each goal can be mapped to one or more phases: https://maven.apache.org/guides/intro
252.
▲
by
danidiaz
13y ago
While useful, Control.Monad.Logic is not really an alternative to core.logic. It is a search monad more than anything, and it doesn't perform any unification or constraint propagation. The type system gets a bit in the way when impleme
253.
▲
by
danidiaz
13y ago
In Haskell there is a kind of syntactic sugar called "do-notation" that simplifies working with monadic code and is bolted onto the core of the language. But it is not necessary , you can program with monads without it. "I
254.
▲
by
danidiaz
13y ago
Not really, they are independent of IO (you may be thinking of monad transformers, which are ways to extend an existing monad.) For example, this is the entire definition of the Maybe monad: data Maybe a = Nothing | Just a de
255.
▲
by
danidiaz
13y ago
Nullable types in C# "The predefined unary and binary operators and any user-defined operators that exist for value types may also be used by nullable types. These operators produce a null value if the operands are null; otherwise, the
256.
▲
by
danidiaz
13y ago
In Haskell, only the IO monad (and perhaps ST as well) is tied to the language's "core". All other monads are conventional Haskell code. It's better to think of them as a sort of design pattern.
257.
▲
by
danidiaz
13y ago
Here's my attempt at a one-pass solution: http://productivedetour.blogspot.com.es/2013/11/my-version-o...
258.
▲
by
danidiaz
13y ago
For maximum modularity, you can combine this with functions like "zoom" and "magnify" of module Control.Lens.Zoom. They let you convert stateful operations that work on a fragment of the global state/environment int
259.
▲
by
danidiaz
13y ago
This link offers three examples: http://www.haskellforall.com/2013/02/you-could-have-invented... (altough I find the object analogy to be unhelpful.) I think the more striking example is the first: "builders&
260.
▲
by
danidiaz
14y ago
Yeah, I had forgotten about filterM. By the way, I like the (fmap not . doesFileExist) bit. It´s cleaner and less cluttered than (\f -> doesFileExist f >>= return . not)
261.
▲
by
danidiaz
14y ago
For printf debugging you can use the "trace" function from Debug.Trace. A "first n files that don't exist" function could be something like: nexist :: Int -> [FilePath] -> IO [FilePath] nexist n l = take n . map fst . filter (not.sn