@kosmikus@functional.cafe avatar

kosmikus

@kosmikus@functional.cafe

I am a partner and Haskell Consultant at Well-Typed LLP. I am also a member of the Haskell Foundation Board, and a co-host on the Haskell Interlude podcast and the Haskell Unfolder YouTube series.

Posting mostly about Haskell, but occasionally also about books I'm reading, video games I'm playing, and other things that interest me.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

kosmikus, to haskell
@kosmikus@functional.cafe avatar
kosmikus, to random
@kosmikus@functional.cafe avatar

I just finished reading the Tide Child (Bone Ships) trilogy by @RJBarker .

I don't even quite remember why I started reading these. It wasn't a recommendation, I just browsed for something interesting and the setting (sailing boats and sea dragons) sounded appealing.

This was one of the most remarkable book series I've read in the last few years. I often feel like I'm so difficult to please, and books that are supposed to be great feel underwhelming to me, so it's a relief if every once in a while it still happens that I'm truly impressed. The setting in these books is quite unique and full of fantastic ideas I won't spoil, the world building is excellent, and the characters are fantastic. I usually like it if characters in stories aren't merely reacting to events unfolding around them. In this story, life certainly isn't easy for any of the main actors, and there are many things that happen to them, but at the same time, it is very clearly their choices and actions that shape the story, and that's what makes it all so rewarding.

I think I have to check out the other books by this author! @RJBarker , you certainly have a new fan!

kosmikus, to haskell
@kosmikus@functional.cafe avatar

A new episode ( already!) of the Unfolder is upcoming! Tomorrow, Wednesday, 2024-02-21 at 1930 UTC Edsko and I will talk about how to translate imperative pseudo-code into idiomatic Haskell, using Dijkstra's shortest path algorithm as an example.

This should be suitable for relative beginners, all Haskell code will be simple and hopefully straight-forward.

Hope to see you all there!

https://www.youtube.com/watch?v=WHVMjMIJnB4&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=20

mangoiv, to random German
@mangoiv@functional.cafe avatar

Hey @kosmikus perhaps something you will like: https://mangoiv.com/ghci-module/ depending on what you said on the podcast. Still a bit barebones still but the idea is what you’re describing :3

kosmikus,
@kosmikus@functional.cafe avatar

@mangoiv These look nice, but to be fair, if the goal is to get something set up as quickly as possible for a random user, then this kind of boilerplate is as much (and more cryptic) than having to conjure up a cabal file. I think @jaror 's suggestion on Discourse of using Cabal script as in https://cabal.readthedocs.io/en/latest/getting-started.html#running-a-single-file-haskell-script probably comes closest.

underlap, to haskell
@underlap@fosstodon.org avatar

New blog post: Understanding Haskell's type system

https://underlap.org/understanding-haskells-type-system

#Haskell

kosmikus,
@kosmikus@functional.cafe avatar

@underlap Nice blog post!

Some random comments: I think the section on "parametric polymorphism" comes a bit suddenly. I'm not quite sure about it's internal structure ("it usually applies to functions, but covers constants too" ? why is one the usual case, the other not?), but even more importantly, I'd have expected this part to somehow explain the relation between parametric polymorphism and overloaded types, yet it does not.

I'm not sure what part of the Wiki "infers concrete types" whenever possible refers to, but I think it's misleading here without further context?

Depending on how exhaustive you want to be, you might want to say that even Haskell 2010 does require type annotations in some cases (most notably for code with otherwise ambiguous types, and for code using polymorphic recursion).

kosmikus,
@kosmikus@functional.cafe avatar

@underlap ah sorry, I did not follow the link, perhaps did not even notice that there was one...

kosmikus,
@kosmikus@functional.cafe avatar

@underlap Regarding principal types: I think it's fair to say Haskell 2010 has principal types. Neither of the examples I gave contradicts this: in the case of ambiguous types there is a principal type, but that type is being rejected (without -XAllowAmbiguousTypes) because it does not allow calling a value of such a type without explicitly specifying which dictionary to pass (e.g. via explicit type applications). In the case of polymorphic recursion there also is a principal type, but type inference does not find it and rejects the program without an explicit type signature.

In contrast, with e.g. GADTs, you can really state programs which allow two or more incomparable Haskell types. Similarly, with rank-n types.

kosmikus, to haskell
@kosmikus@functional.cafe avatar
kosmikus, to haskell
@kosmikus@functional.cafe avatar
kosmikus, to haskell
@kosmikus@functional.cafe avatar

Looking forward to the #Haskell Unfolder tomorrow (2024-01-31) at 1930 UTC: Edsko and I will take a look at a function called repeatedly and discuss its relation to foldl'. After recently having looked at a couple of somewhat more advanced topics, this should very much be a beginner-friendly episode.

https://www.youtube.com/watch?v=pQThkisvsVs&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=19

chris__martin, to random
@chris__martin@functional.cafe avatar

why do haskellers deal with libraries that jump through crazy hoops to get automatic lifting in optic composition, while for everything else manual lifting is fine?

kosmikus,
@kosmikus@functional.cafe avatar

@chris__martin I agree that what you describe would be a good option. But is the point in the design space that the optics package occupies so bad in practice? I usually find the error messages reasonable, and the types are opaque, so they actually show up in HLS, error messages, holes etc.

FWIW, I think the argument in favour of the other approach (transparent types as in the lens package) is that what you are doing is just function composition, and you can "add" new kinds of optics by simply discovering them rather than having to design for them in advance.

leobm, to haskell German
@leobm@norden.social avatar

Basically, I understand the concepts of functional programming quite well and can also programme #purescript or #haskell relatively confidently. But when it comes to #typelevel programming, I haven't quite got over this threshold yet. I would really like to understand everything better and learn more in this area, because many cool libraries are based on it.

kosmikus,
@kosmikus@functional.cafe avatar

@BoydStephenSmithJr @leobm @edwinb I think that in general, when it comes to type-level programming, it might be useful to look at a dependently-typed language (like Idris, but also Agda, Lean, ...) where this sort of stuff can more elegantly be done. Of course, Haskell currently has more libraries and more real-world applications, but many type-level concepts still feel bolted on, somewhat ugly, and you have to encode some things in weird ways because some stuff is simply missing. If you've seen these ideas how they're meant to be, then I think it's easier to understand them in Haskell or Purescript as well.

kosmikus,
@kosmikus@functional.cafe avatar

@BoydStephenSmithJr @leobm @edwinb I think so, but I haven't used Lean as much as I'd like.

kosmikus, to haskell
@kosmikus@functional.cafe avatar

I'm looking forward to the first #Haskell Unfolder episode of 2024, tonight, 2024-01-17 at 1930 UTC live on YouTube. Edsko and I will look at a special case of type-level programming. We will show how to compute (with) constraints over type-level lists, and also revisit the topic of class aliases which we've briefly mentioned in earlier episodes.

https://www.youtube.com/watch?v=JzymjoHC0ig&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=18

Profpatsch, to haskell
@Profpatsch@mastodon.xyz avatar

on, the most useless function in #haskell base. There’s really never a situation where inlining it doesn’t make the code easier to understand.

kosmikus,
@kosmikus@functional.cafe avatar

@Profpatsch Hmm, I quite like it.

arialdo, to haskell
@arialdo@mastodon.online avatar

f = foldr (flip (const . (+1))) 0

#haskell

kosmikus,
@kosmikus@functional.cafe avatar

@arialdo Should be foldl'. Better:

g = foldl' (const . (+1)) 0

kosmikus, to random
@kosmikus@functional.cafe avatar

Finished playing Heaven's Vault over the holidays (because @mheinzel mentioned it a while ago). Very beautiful, very calm game. Quite enjoyable and relaxing.

Now playing Hogwarts Legacy. Obviously very different, but also quite impressive so far.

kosmikus,
@kosmikus@functional.cafe avatar

@mheinzel @Profpatsch Outer Wilds is a marvellous game. You are so lucky to still have it ahead of you.

kosmikus,
@kosmikus@functional.cafe avatar

@mheinzel @Profpatsch Yes, good strategy. Avoid all spoilers. Also, be warned that I had my problems with the controls initially that diminished the first impression a bit. It's worth persisting through that.

kosmikus, to haskell
@kosmikus@functional.cafe avatar

#AdventOfCode Day 23 done in #Haskell. One of the rare cases where I had a more sophisticated algorithm for Part 1 than I ended up using for Part 2 ...

kosmikus,
@kosmikus@functional.cafe avatar

@mangoiv There are still two more days :)

user8e8f87c, to haskell
@user8e8f87c@berlin.social avatar

#Haskell people, what do you prefer?

void iOFunction  

or

 _ <- iOFunction  

and why? Is there any difference?

#FP #FunctionalPrograming #Programming

kosmikus,
@kosmikus@functional.cafe avatar

@user8e8f87c I find both totally acceptable and consider it a matter of personal taste.

kosmikus, to random
@kosmikus@functional.cafe avatar

Getting very close to the end (as in 100%) of Super Mario Bros. Wonder. This was as fun as expected. It's remarkable that Nintendo somehow manage to consistently release high-quality games for their major IPs with hardly ever any real misses. Also great to see that my daughter is now completing everything nearly as quickly as I am. One more year or so, and I'll be chanceless in comparison.

kosmikus,
@kosmikus@functional.cafe avatar

@kolmodin Yes, well, I'd say a Switch is definitely worth buying, even if a new Nintendo console is probably going to be announced soon. There are plenty of really good and family-friendly games available, and I really like that you can take it with you when needed.

kosmikus, to haskell
@kosmikus@functional.cafe avatar

#AdventOfCode Day 22 done in #Haskell. After the rather weird previous two days where the exact nature of the input played a large role, this was finally a rather straight-forward and enjoyable programming task again.

kosmikus,
@kosmikus@functional.cafe avatar

@mindshoot @aoanla It's the first year I'm really doing it as well, in all the previous years I've usually given up after just a day or two. Overall, yes, it's been costing time, but I'd say I've also been enjoying it and I've been learning quite a few things (using new libraries, writing algorithms I usually rarely end up writing), and the more annoying parts have been comparatively rare.

I would say that there's a danger though to let it become a massive time sink and not enjoying it at all anymore. It somewhat sounds like you may be in that situation. Don't let peer pressure get to you. I totally understand lack of time. If it becomes a chore, it's probably better to just let it be ...

Well-Typed Blog: Haskell Symposium 2023 (well-typed.com)

The Haskell Symposium is a two-day workshop co-located with the International Conference on Functional Programming (ICFP). In a previous blog post we discussed the Haskell Implementors’ Workshop (HIW), which is another Haskell-workshop co-located with ICFP, but unlike HIW, the Haskell Symposium is a scientific workshop with...

kosmikus,
@kosmikus@functional.cafe avatar

@jaror @mangoiv I think compared to many commercial events targeted primarily at industrial users, ICFP + associated workshops is still not overly expensive. What I still don't understand is why it would be better to turn a historically primarily academic conference into something else rather than just try to create a different event. It's a bit sad that HaskellX isn't happening this year for unrelated reasons, but it used to be a good conference that was much less academic. So this can work. But if you decouple Haskell Symposium from ICFP, you'll probably have to re-build it completely anyway, because it'll lose all the academic audience it now automatically gets due to ICFP, and then I'm not sure if the brand is so important that it's better than to use a different one. Also, it's extremely risky. If you moved it away from ICFP, it might not be possible to easily undo that change.

Also, one thing to keep in mind, I don't think Haskell Symposium is suffering from a lack of attendance. It's primarily suffering from a lack of academic paper submissions. Other language workshops co-located with ICFP are mostly less serious (i.e., are encouraging more workshop-like work in progress and don't necessarily require full-paper submissions). Haskell Symposium is in a somewhat strange spot where it requires bascially the same amount of work and effort you'd put into a "full" ICFP submission, but it has much less prestige to people outside of the community that try to quantify the research output of individual researchers in order to decide whether they're worth funding / hiring (which, btw, I hate, but it's nevertheless a reality). So I think the main way to fix this is to either make it less serious as well, or to try make it more prestigious, the former being easier than the latter.

Perhaps making it less serious, but still co-locating with ICFP could also make it more interesting to industrial participants in itself, because it would make it easier for people not part of and familiar with the academic research community to get a presentation slot.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • bokunoheroacademia
  • rhentai
  • InstantRegret
  • mdbf
  • Youngstown
  • everett
  • modclub
  • slotface
  • Durango
  • DreamBathrooms
  • kavyap
  • cisconetworking
  • osvaldo12
  • rosin
  • HellsKitchen
  • magazineikmin
  • khanakhh
  • tacticalgear
  • tester
  • ethstaker
  • GTA5RPClips
  • Leos
  • thenastyranch
  • relationshipadvice
  • normalnudes
  • cubers
  • lostlight
  • sketchdaily
  • All magazines