A new parser generator for Java 17, with grammar as algebraic datatypes github.com/zhong-j-yu/rek…
πŸ‘︎ 35
πŸ’¬︎
πŸ‘€︎ u/zhong-j-yu
πŸ“…︎ Sep 27 2021
🚨︎ report
Practical introduction to algebraic datatypes (ADTs) in TypeScript medium.com/@el3ng/practic…
πŸ‘︎ 50
πŸ’¬︎
πŸ‘€︎ u/Elinew
πŸ“…︎ Aug 10 2021
🚨︎ report
Underappreciated programming language concepts or features? ... Algebraic datatypes (including sum types / tagged unions) and pattern matching. reddit.com/r/ProgrammingL…
πŸ‘︎ 16
πŸ’¬︎
πŸ‘€︎ u/fp_weenie
πŸ“…︎ Jul 06 2020
🚨︎ report
Proving Algebraic Datatypes are β€œAlgebraic” soap.coffee/~lthms/posts/…
πŸ‘︎ 108
πŸ’¬︎
πŸ‘€︎ u/bjzaba
πŸ“…︎ Jul 12 2020
🚨︎ report
I try to understand why Haskell Algebraic Datatype so significant from Java developer's point of view.

We know We have enum type and we never talk about Algebraic Datatype in Java? Why?

I love to see some examples from Haskell and Java to show why Algebraic Datatype so powerful In Haskell?

Or you can throw some Generic Algebraic Data Type examples, but I still struggling to understand what is GADT.

    public enum {
        Type1, Type2, Type3
    }



    -- Sum type
    data MyType a = Type1 a | Type2 a | Type3 a



    -- product type
    data CartesianProduct a = Product a a
πŸ‘︎ 17
πŸ’¬︎
πŸ‘€︎ u/ellipticcode0
πŸ“…︎ May 21 2019
🚨︎ report
Is there an algebraic datatype that corresponds to sets?

For example,

data List a = Cons a (List a) | Nil
data Tree a = B (Tree a) a (Tree a) | Empty 

Correspond to lists and trees. Is there something analogous for sets? Or does that require more advanced types than Haskell supports?

πŸ‘︎ 11
πŸ’¬︎
πŸ‘€︎ u/mode_2
πŸ“…︎ Oct 12 2019
🚨︎ report
[ScalaIO FR]Algebraic DataTypes in Scala. Where is the algebra? - Harry Laoulakos youtube.com/watch?v=t7dYe…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/know_not_much
πŸ“…︎ Feb 11 2020
🚨︎ report
What's in an algebraic datatype ? blog.emillon.org/posts/20…
πŸ‘︎ 52
πŸ’¬︎
πŸ‘€︎ u/tinou
πŸ“…︎ Dec 14 2011
🚨︎ report
HLHT Ch14: Simple Intro to Algebraic (Product) DataTypes with Cat Breeds! happylearnhaskelltutorial…
πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/GetContented
πŸ“…︎ Apr 06 2016
🚨︎ report
Cyclone for C programmers: A Safe Dialect of C (with pattern matching, algebraic datatypes, exceptions, region-based memory management, and optional garbage collection) cyclone.thelanguage.org/w…
πŸ‘︎ 38
πŸ’¬︎
πŸ‘€︎ u/doublec
πŸ“…︎ Oct 24 2007
🚨︎ report
Deriving Law-Abiding Instances: "[W]e can take any algebraic datatype, generate an equivalent representation type, and have Liquid Haskell automatically construct (and prove) an isomorphism between the original type and the representation type." [PDF] arxiv.org/pdf/1708.02328.…
πŸ‘︎ 49
πŸ’¬︎
πŸ‘€︎ u/flexibeast
πŸ“…︎ Aug 09 2017
🚨︎ report
Algebraic Datatypes and Pattern Matching in Python github.com/benanhalt/PyAl…
πŸ‘︎ 18
πŸ’¬︎
πŸ‘€︎ u/DeadFinks
πŸ“…︎ Apr 27 2013
🚨︎ report
Functional Scala: Algebraic Datatypes - Enumerated Types gleichmann.wordpress.com/…
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/kikibobo
πŸ“…︎ Jan 31 2011
🚨︎ report
A proposal for Extensible Open Algebraic Datatypes in OCaml (with implementation) sites.google.com/site/oca…
πŸ‘︎ 10
πŸ’¬︎
πŸ‘€︎ u/gasche
πŸ“…︎ May 22 2012
🚨︎ report
Functional Scala: a little expression language with algebraic datatypes and pattern matching gleichmann.wordpress.com/…
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/kikibobo
πŸ“…︎ Mar 06 2011
🚨︎ report
Functional Scala: Algebraic Datatypes - 'sum of products' types gleichmann.wordpress.com/…
πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/bohne
πŸ“…︎ Feb 09 2011
🚨︎ report
Functional Scala: Algebraic Datatypes – Sum and Product Types gleichmann.wordpress.com/…
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/bohne
πŸ“…︎ Feb 07 2011
🚨︎ report
Differentiation, Calculus of Algebraic Datatypes (e.g. how you derive zippers) homepage.mac.com/sigfpe/C…
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/Xiphorian
πŸ“…︎ Mar 26 2008
🚨︎ report
Functional Scala: a little expression language with algebraic datatypes and pattern matching gleichmann.wordpress.com/…
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/gst
πŸ“…︎ Mar 07 2011
🚨︎ report
Simulating Dependent Types with Guarded Algebraic Datatypes cs.virginia.edu/~jba5b/si…
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/dons
πŸ“…︎ Jan 01 2009
🚨︎ report
An intuition for reflection: "I am speaking of the principle from the algebra of programming that is called reflection ... It is a property relating eliminations and constructions of datatypes." queuea9.wordpress.com/202…
πŸ‘︎ 25
πŸ’¬︎
πŸ‘€︎ u/flexibeast
πŸ“…︎ Apr 02 2020
🚨︎ report
Math classes for PL

Hello,

I am an undergraduate CS student planning on eventually pursuing a PhD (and hopefully career) in PL, more towards the theoretical end of the spectrum. I'm wondering what might be some good math classes to take. I'd assume that category theory, formal logic, and a models of computation course would be a good idea?

I am particularly interested in type theory and know that HoTT has roots in algebraic topology: would it be a good idea to try and take a class on that? If anyone has other suggestions that would be great.

πŸ‘︎ 34
πŸ’¬︎
πŸ‘€︎ u/sdmc1234
πŸ“…︎ Dec 17 2021
🚨︎ report
All the same thing? ADTs, sum types, discrimnated unions, tagged union, etc... Preferred term?

I'm never sure what to search for when I'm looking for content on these things. Or even what to call them them I'm discussing online etc...

  1. https://en.wikipedia.org/wiki/Tagged_union
  2. https://en.wikipedia.org/wiki/Algebraic_data_type

I have a few questions related to this, I'll post them as separate comments below so that it makes it easier to reply to each separately.

For context of my background, I use these in TypeScript, and Rust (enums). And I've done some tinkering in Haskell. Those are the most-FP languages that I know. The only other languages I know are C# and PHP.

πŸ‘︎ 17
πŸ’¬︎
πŸ‘€︎ u/r0ck0
πŸ“…︎ Oct 29 2021
🚨︎ report
Meta-patterns: abstracting over the class 'instance cls F'

What to call these? Patterns like Ap themselves follow a meta-pattern which specifies applicative lifting where the operations all have the form opn = liftAn opn.. give or take lifting constants. Assume simplified classes and liftA0 = pure

instance (Applicative f, Semigroup a) => Semigroup (Ap f a) where
  (<>) = liftA2 (<>)
instance (Applicative f, Monoid a) => Monoid (Ap f a) where
  mempty = liftA0 mempty
instance (Applicative f, Bounded a) => Bounded (Ap f a) where
  minBound = liftA0 minBound
  maxBound = liftA0 maxBound
instance (Applicative f, Num a) => Num (Ap f a) where
  (+) = liftA2 (+)
  (-) = liftA2 (-)
  (*) = liftA2 (*)
  abs = liftA abs
  ..
  fromInteger = liftA0 . fromInteger

The pattern is somewhat simple but with no way to capture it, except by repeating it for every algebra. The instance head cannot be a type variable

instance (Applicative f, cls a) => cls (Ap f a) where
  ??

What would such a solution even look like? I don't want to get distracted by if the instance are all lawful, just capturing this meta-pattern the emerges.

  • A generic representation for type classes to parallel Generic for datatypes.

  • It can be implemented as a GHC plugin, like Evoke (blog, reddit, reddit)

  • Or created on the fly by GHC, which is privy to the internal structure of type classes

      instance (Applicative f, cls a) => cls (Stocking1 Ap f a)
πŸ‘︎ 11
πŸ’¬︎
πŸ‘€︎ u/Iceland_jack
πŸ“…︎ Dec 02 2021
🚨︎ report
SERIOUS: This subreddit needs to understand what a "dad joke" really means.

I don't want to step on anybody's toes here, but the amount of non-dad jokes here in this subreddit really annoys me. First of all, dad jokes CAN be NSFW, it clearly says so in the sub rules. Secondly, it doesn't automatically make it a dad joke if it's from a conversation between you and your child. Most importantly, the jokes that your CHILDREN tell YOU are not dad jokes. The point of a dad joke is that it's so cheesy only a dad who's trying to be funny would make such a joke. That's it. They are stupid plays on words, lame puns and so on. There has to be a clever pun or wordplay for it to be considered a dad joke.

Again, to all the fellow dads, I apologise if I'm sounding too harsh. But I just needed to get it off my chest.

πŸ‘︎ 17k
πŸ’¬︎
πŸ‘€︎ u/anywhereiroa
πŸ“…︎ Jan 15 2022
🚨︎ report
Blind Girl Here. Give Me Your Best Blind Jokes!

Do your worst!

πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/Leckzsluthor
πŸ“…︎ Jan 02 2022
🚨︎ report
This subreddit is 10 years old now.

I'm surprised it hasn't decade.

πŸ‘︎ 14k
πŸ’¬︎
πŸ‘€︎ u/frexyincdude
πŸ“…︎ Jan 14 2022
🚨︎ report
Dropped my best ever dad joke & no one was around to hear it

For context I'm a Refuse Driver (Garbage man) & today I was on food waste. After I'd tipped I was checking the wagon for any defects when I spotted a lone pea balanced on the lifts.

I said "hey look, an escaPEA"

No one near me but it didn't half make me laugh for a good hour or so!

Edit: I can't believe how much this has blown up. Thank you everyone I've had a blast reading through the replies πŸ˜‚

πŸ‘︎ 20k
πŸ’¬︎
πŸ‘€︎ u/Vegetable-Acadia
πŸ“…︎ Jan 11 2022
🚨︎ report
What starts with a W and ends with a T

It really does, I swear!

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/PsychedeIic_Sheep
πŸ“…︎ Jan 13 2022
🚨︎ report
Why did Karen press Ctrl+Shift+Delete?

Because she wanted to see the task manager.

πŸ‘︎ 11k
πŸ’¬︎
πŸ‘€︎ u/Eoussama
πŸ“…︎ Jan 17 2022
🚨︎ report
What is a a bisexual person doing when they’re not dating anybody?

They’re on standbi

πŸ‘︎ 11k
πŸ’¬︎
πŸ‘€︎ u/Toby-the-Cactus
πŸ“…︎ Jan 12 2022
🚨︎ report
Geddit? No? Only me?
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/shampy311
πŸ“…︎ Dec 28 2021
🚨︎ report
I wanna hear your best airplane puns.

Pilot on me!!

πŸ‘︎ 3k
πŸ’¬︎
πŸ‘€︎ u/Paulie_Felice
πŸ“…︎ Jan 07 2022
🚨︎ report
E or ß?
πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/Amazekam
πŸ“…︎ Jan 03 2022
🚨︎ report
What did Spartacus say when the lion ate his wife?

Nothing, he was gladiator.

πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/rj104
πŸ“…︎ Jan 15 2022
🚨︎ report
Pun intended.
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/Sharmaji1301
πŸ“…︎ Jan 15 2022
🚨︎ report
No spoilers
πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/Onfour
πŸ“…︎ Jan 06 2022
🚨︎ report
Covid problems
πŸ‘︎ 7k
πŸ’¬︎
πŸ‘€︎ u/theincrediblebou
πŸ“…︎ Jan 12 2022
🚨︎ report
These aren't dad jokes...

Dad jokes are supposed to be jokes you can tell a kid and they will understand it and find it funny.

This sub is mostly just NSFW puns now.

If it needs a NSFW tag it's not a dad joke. There should just be a NSFW puns subreddit for that.

Edit* I'm not replying any longer and turning off notifications but to all those that say "no one cares", there sure are a lot of you arguing about it. Maybe I'm wrong but you people don't need to be rude about it. If you really don't care, don't comment.

πŸ‘︎ 12k
πŸ’¬︎
πŸ‘€︎ u/Lance986
πŸ“…︎ Dec 15 2021
🚨︎ report
I had a vasectomy because I didn’t want any kids.

When I got home, they were still there.

πŸ‘︎ 10k
πŸ’¬︎
πŸ‘€︎ u/demotrek
πŸ“…︎ Jan 13 2022
🚨︎ report
What did 0 say to 8 ?

What did 0 say to 8 ?

" Nice Belt "

So What did 3 say to 8 ?

" Hey, you two stop making out "

πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/designjeevan
πŸ“…︎ Jan 03 2022
🚨︎ report
Spi__
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/Fast_Echidna_8520
πŸ“…︎ Jan 11 2022
🚨︎ report
I dislike karma whores who make posts that imply it's their cake day, simply for upvotes.

I won't be doing that today!

πŸ‘︎ 15k
πŸ’¬︎
πŸ‘€︎ u/djcarves
πŸ“…︎ Dec 27 2021
🚨︎ report
The Ancient Romans II
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/mordrathe
πŸ“…︎ Dec 29 2021
🚨︎ report
I'd like to dedicate this joke to my wisdom teeth.

[Removed]

πŸ‘︎ 7k
πŸ’¬︎
πŸ‘€︎ u/ThoughtPumP
πŸ“…︎ Jan 14 2022
🚨︎ report
Where do you find a cow with no legs?

Where ever you left it πŸ€·β€β™€οΈπŸ€­

πŸ‘︎ 3k
πŸ’¬︎
πŸ‘€︎ u/kitkatty0309
πŸ“…︎ Jan 16 2022
🚨︎ report
I did it, I finally did it. After 4 years and 92 days I went from being a father, to a dad.

This morning, my 4 year old daughter.

Daughter: I'm hungry

Me: nerves building, smile widening

Me: Hi hungry, I'm dad.

She had no idea what was going on but I finally did it.

Thank you all for listening.

πŸ‘︎ 17k
πŸ’¬︎
πŸ‘€︎ u/Sk2ec
πŸ“…︎ Jan 01 2022
🚨︎ report
It this sub dead?

There hasn't been a post all year!

πŸ‘︎ 13k
πŸ’¬︎
πŸ‘€︎ u/TheTreelo
πŸ“…︎ Jan 01 2022
🚨︎ report
How do you stop Canadian bacon from curling in your frying pan?

You take away their little brooms

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/Majorpain2006
πŸ“…︎ Jan 09 2022
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.