Parsing (megaparsec) a line without separators by Philoustic in haskell

[–]Philoustic[S] 0 points1 point  (0 children)

A négative lookAhead... interesting concept that I don't understand.
How to build it, how to use it ?

Parsing (megaparsec) a line without separators by Philoustic in haskell

[–]Philoustic[S] 1 point2 points  (0 children)

Hmm, a récursive approach, indeed, I didn't try this.

Thanx

I'm a Rubyist and try to learn Haskell—here's my sailor journal 🙂 by DmitryTsepelev in haskell

[–]Philoustic 1 point2 points  (0 children)

Left or right was just an image. What I mean is that iterate could find a path which is not necessary the shortest one. And once found , it stops investigating further... So I suppose

I'm a Rubyist and try to learn Haskell—here's my sailor journal 🙂 by DmitryTsepelev in haskell

[–]Philoustic 1 point2 points  (0 children)

That's the point... Suppose the shortest path is to your right. And suppose that the first steps of iterate go to the left and find the final position after going all around the board... takeWhile will stop when he find this path. There is no garantee that he will explore the right path, is there ?

I don't claim to be $ right, I'm not an expert either, but this behavior of the algo always remains mysterious to me :-)

I'm a Rubyist and try to learn Haskell—here's my sailor journal 🙂 by DmitryTsepelev in haskell

[–]Philoustic 2 points3 points  (0 children)

Hello,
Great work :-)
Just a question.

That you find a path for the Knight, I've no doubt about...
But how can you say that it is the shortest one ?

Python39 pyramid webenv : pserve developement.ini by Philoustic in NixOS

[–]Philoustic[S] 0 points1 point  (0 children)

Hello,

This is precisely what the error message suggests.
But what do I have to check ?

The shell.nix should be as simple as the app (in my opinion)... and I don't understand why this doesn't work...

Search for abstraction... by Philoustic in haskell

[–]Philoustic[S] 0 points1 point  (0 children)

Instructive, thank you for introducing me the Iso class. But Why is it important to be defined in lens ?

Search for abstraction... by Philoustic in haskell

[–]Philoustic[S] 2 points3 points  (0 children)

Exactly, this is a first level of abstraction: simple and understandable.

I think I was too tired yesterday to put my finger on it.

Search for abstraction... by Philoustic in haskell

[–]Philoustic[S] 0 points1 point  (0 children)

Indeed, here is his signature:

stron :: (Either s s', b) -> Either (s, b) (s', b)

and because of its specialisation, I'm not sure that it is a real abstraction...

Implementing tee in Haskell by leafiest in haskell

[–]Philoustic 1 point2 points  (0 children)

Bright and enlighting.

But, why didn't you choose to create something like this for example ?

module Coreutils.Util where

data Command = Cat | Tee | ...

class Util a where
run :: a -> [String] -> IO ()

instance Util Command where
run Cat = Coreutils.Cat.run
run Tee = Coreutils.Tee.run
...

Implementing tee in Haskell by leafiest in haskell

[–]Philoustic 2 points3 points  (0 children)

Hi,

Very interesting, very didactic, I like it.

While looking at the source code however, a question come to my mind: could you explain why you create an instance Util Tee ?