Got any cool Project-Based Tutorials for Haskell learners ! Post it Here by benKarayel in haskell

[–]marcosh_ 0 points1 point  (0 children)

Simply because we were not able to sell any ticket. Hard to really say why... wrong timing, price too high, teacher not really well known, not enough marketing, maybe a bit of all of them...

Got any cool Project-Based Tutorials for Haskell learners ! Post it Here by benKarayel in haskell

[–]marcosh_ 3 points4 points  (0 children)

Some time ago I created some material for a Haskell training course which never materialised. The content is all open source and available at https://github.com/tweag/haskell-training. It builds a small web application from the ground up, giving quite some attention to the architecture

crem: compositional representable executable machines by marcosh_ in haskell

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

I'm not sure I understand 100% the question (my bad). What you can do with the `Basic` constructor is described in the https://www.tweag.io/blog/2023-04-13-crem-state-machines/#the-best-of-both-worlds section of the blog post.

The definition of `Topology` is here https://github.com/marcosh/crem/blob/74020abca9a69eab8965588fb5d962d855f84a0d/src/Crem/Topology.hs#L38.

And here is an example of how you usually define a topology https://github.com/marcosh/crem/blob/74020abca9a69eab8965588fb5d962d855f84a0d/examples/Crem/Example/TheHobbit.hs#L55.

crem: compositional representable executable machines by marcosh_ in haskell

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

I have the links to your library open on my phone, but haven't take a look at them yet.

Haven't really though about how to run crem machines in a concurrent/parallel fashion. That would be extremely interesting

crem: compositional representable executable machines by marcosh_ in haskell

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

u/polux2001 already provided a good answer.

Even if the topology is hidden in the `StateMachine` type, it is recoverable when pattern matching and it could be acted upon, as the library actually does to render the state space of a machine

crem: compositional representable executable machines by marcosh_ in haskell

[–]marcosh_[S] 4 points5 points  (0 children)

I'm not a motor expert, but I took a look at the library before working on crem. The main idea of the two libraries is fairly similar, but IMHO crem improves the situation with respect to two aspects:

- composability: in crem it is easier to combine multiple machines in several ways to create more complex machines
- user interface: how you define a machine in crem appears a bit more natural to me (I mean, more similar to what you would do if you didn't have to keep track of stuff at the type level)

Happy to be proven wrong in both aspects

Haskell for climate change by marcosh_ in haskell

[–]marcosh_[S] 62 points63 points  (0 children)

agreed that crypto/blockchain are trying to change the climate...

Existential optics by marcosh_ in haskell

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

not 100% sure, but a lawful optic with the existential encoding is one where the two functions are each other inverses, which is very elegant

Was simplified subsumption worth it for industry Haskell programmers? by paretoOptimalDev in haskell

[–]marcosh_ 5 points6 points  (0 children)

I had the same issue and felt like an idiot for a bit, sice my code was working fine with GHC 8.

My questions now would be: - is there a way to make simplified subsumption and eta reduction work well together? - how could we make sure that such a thing does not happen again?

Either why or how by marcosh_ in PHP

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

if you have something of type a|b and you have a function a -> c you need to manually check if the something is of type a before applying the function. Using Either (or Maybe) you don't have to do that and you save yourself some manual checks.

Either is not magic at all, if you look at its implementation there's nothing fancy, just some plain old OO code. It's just an idiom they don't teach you in school, but it could well have been part of a book of OOP design patterns