Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-25 15:01:25 <HelplessProgramm> data Atom = Atom { _nomPredicat::String, _termes::[ Term ] }
2021-04-25 15:01:26 <HelplessProgramm>   deriving (Eq, Show)
2021-04-25 15:01:26 <HelplessProgramm> type Sustitucio = [ (Term, Term) ] -- [(variable, constant), (variable, constant), ...]
2021-04-25 15:02:26 <HelplessProgramm> So basically sustitucio is a list of tuples
2021-04-25 15:02:48 <ski> ok
2021-04-25 15:03:04 <gnumonic> You probably shouldn't be using a list of tuples?
2021-04-25 15:03:11 <ski> i think it would be better to use `null' rather than `== []' .. and even better to use pattern-matching
2021-04-25 15:03:15 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-04-25 15:03:32 <gnumonic> Unless this is an assignment and you have to, a Data.Map map would be better...
2021-04-25 15:03:37 <ski> and you need to show `sustitueixCamps', i think
2021-04-25 15:03:38 <HelplessProgramm> Im kinda new, this is for school, i didnt do the definitions
2021-04-25 15:04:02 <HelplessProgramm> Yeah sustitueixCamps was a function i tried but i deleted it already
2021-04-25 15:04:21 × Guest42540 quits (~textual@2603-7000-3040-0000-8d26-87d2-93d2-7b51.res6.spectrum.com) (Ping timeout: 250 seconds)
2021-04-25 15:04:37 × wei2912 quits (~wei2912@unaffiliated/wei2912) (Remote host closed the connection)
2021-04-25 15:04:47 <ski> it sounds like defining it would be a good start
2021-04-25 15:05:02 <HelplessProgramm> So for each item in Sustitucio, if the tuple is (a,b) i have to search all occurrences of a in the Atom _termes and replace them with b
2021-04-25 15:05:11 <HelplessProgramm> I dont know if it sounds confusing
2021-04-25 15:05:21 <ski> oh, also .. you're not dealing with arrays, that i can see, but rather dealing with lists
2021-04-25 15:05:36 <ski> that sounds like a plan, sure
2021-04-25 15:05:37 <HelplessProgramm> yeah sorry
2021-04-25 15:05:37 × notzmv quits (~zmv@unaffiliated/zmv) (Ping timeout: 252 seconds)
2021-04-25 15:05:39 <HelplessProgramm> Its a list
2021-04-25 15:06:30 chimera joins (~chimera@168-182-134-95.pool.ukrtel.net)
2021-04-25 15:06:58 <HelplessProgramm> But the language not being imperative is so frustrating to me
2021-04-25 15:07:01 <HelplessProgramm> I cant do anything
2021-04-25 15:07:21 <gnumonic> https://paste.tomsmeding.com/S6OXDjd3 something like that should work for you i think (hopefully i typed the url right my clipboard isn't working). also i just woke up and didn't test that soooo hopefully i did it right
2021-04-25 15:07:40 × idhugo quits (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net) (Remote host closed the connection)
2021-04-25 15:08:13 <HelplessProgramm> omgg thank you so much
2021-04-25 15:08:14 <ski> please forget what you know about (imperative) programming. you will have to unlearn some habits and ways of thinking. learning a new programming paradigm is always a bit like learning to program from scratch, all over again
2021-04-25 15:09:04 <gnumonic> haskell was my first language and i'm trying to learn rust and C atm so i feel your pain, it can be hard to adapt
2021-04-25 15:09:19 jgt joins (~jgt@78.162.43.217)
2021-04-25 15:09:32 <ski> gnumonic :(
2021-04-25 15:09:34 <maerwald> once you discover monads, you'll realize we just hid imperative programming behind a fancy word
2021-04-25 15:09:49 <HelplessProgramm> I tried to understand that
2021-04-25 15:09:52 <HelplessProgramm> And functors
2021-04-25 15:09:56 <HelplessProgramm> But my brain breaks
2021-04-25 15:10:14 Tops2 joins (~Tobias@dyndsl-095-033-093-085.ewe-ip-backbone.de)
2021-04-25 15:10:18 <ski> @quote is.the.solution
2021-04-25 15:10:18 <maerwald> brain recovers quickly
2021-04-25 15:10:18 <lambdabot> quicksilver says: head-explosion is the solution, not the problem.
2021-04-25 15:10:30 <maerwald> just make sure your bones are ok
2021-04-25 15:12:56 <gnumonic> ski: if there were more haskell jobs i'd just stick with FP :-( (Unless your sad face was for giving him the solution lol)
2021-04-25 15:13:10 <ski> (the latter)
2021-04-25 15:13:40 xkapastel joins (uid17782@gateway/web/irccloud.com/x-ffvsvgtndmjolwtr)
2021-04-25 15:15:45 ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-04-25 15:16:32 × dastomaten quits (~dastomate@0543f40b.skybroadband.com) (Ping timeout: 240 seconds)
2021-04-25 15:16:34 nicholasbulka joins (~nicholasb@2601:900:4301:da0:58e6:3a0a:96a:ca2c)
2021-04-25 15:17:20 <gnumonic> eh there's value to figuring something out yourself but there's also value in seeing examples to help you pick up on unfamiliar patterns. i think? i dunno.
2021-04-25 15:17:39 dastomaten joins (~dastomate@0543f40b.skybroadband.com)
2021-04-25 15:17:43 <[exa]> gnumonic: you don't want to learn C (and likely not even rust). Learn how assembly works (that's in fact easy), then you can intuitively produce rough descriptions of what you'd like the computer to do in C. :]
2021-04-25 15:18:03 Sheilong joins (uid293653@gateway/web/irccloud.com/x-dlsyikshxdkdktlg)
2021-04-25 15:19:19 electricityZZZZ joins (~electrici@135-180-3-82.static.sonic.net)
2021-04-25 15:20:21 × ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 260 seconds)
2021-04-25 15:20:24 <ski> learning at least one assembler is useful, yes
2021-04-25 15:20:47 <hpc> rust is a perfectly fine almost-haskell imo
2021-04-25 15:21:25 <gnumonic> exa: i appreciate that advice and i have no doubt that you are correct, but I need to have a job in a few months and so my reason for learning other languages is more "need to know something for which entry level positions exist" than "optimum path to mastery of the best techniques" :-(
2021-04-25 15:22:04 × nicholasbulka quits (~nicholasb@2601:900:4301:da0:58e6:3a0a:96a:ca2c) (Ping timeout: 245 seconds)
2021-04-25 15:24:32 <gnumonic> tho probably shouldn't be focusing on rust for that either but it has Good Types and is therefore an OK bridge to imperative stuff
2021-04-25 15:26:11 × jgt quits (~jgt@78.162.43.217) (Ping timeout: 268 seconds)
2021-04-25 15:26:49 × CrazyPython quits (~crazypyth@98.122.164.118) (Read error: Connection reset by peer)
2021-04-25 15:27:13 CrazyPython joins (~crazypyth@98.122.164.118)
2021-04-25 15:27:37 × stree quits (~stree@68.36.8.116) (Ping timeout: 252 seconds)
2021-04-25 15:27:42 jgt joins (~jgt@46.154.28.182)
2021-04-25 15:28:17 <DigitalKiwi> hpc: how so? (very limited knowledge on this) seems to me it's a far cry from being even an almost-haskell
2021-04-25 15:28:18 × son0p quits (~ff@181.136.122.143) (Remote host closed the connection)
2021-04-25 15:28:30 idhugo joins (~idhugo@80-62-116-231-mobile.dk.customer.tdc.net)
2021-04-25 15:29:05 <ski> sum types with pattern-matching ?
2021-04-25 15:29:18 <hpc> it has algebraic data types, an emphasis on pattern matching, and an emphasis on expressions over statements
2021-04-25 15:29:28 <jgt> gnumonic: I'm totally with you on that opinion. It's not fun to have to understand everything from first principles.
2021-04-25 15:29:45 <hpc> even up to when a block has a return value, it's just that value on its own line instead of "return value"
2021-04-25 15:29:50 <DigitalKiwi> like it's got some nice types yes but that's only a fraction of "what makes" haskell "haskell"
2021-04-25 15:30:01 alx741 joins (~alx741@181.196.69.117)
2021-04-25 15:30:06 son0p joins (~ff@181.136.122.143)
2021-04-25 15:30:07 <hpc> and values are immutable by default
2021-04-25 15:30:10 <maerwald> hpc: which is terrible for readibility
2021-04-25 15:30:21 <maerwald> if you add ; then it has a different meaning
2021-04-25 15:31:19 carlomagno joins (~cararell@148.87.23.10)
2021-04-25 15:31:55 <maerwald> anyway, rust is neither lazy, nor functional. But it shows that what we really want is 1. ADTs and 2. dealing with mutability in a reasonable way
2021-04-25 15:32:49 <maerwald> functional in its own is less significant imo
2021-04-25 15:33:25 <gnumonic> it'd be neat if it had higher kinded types. i think it *could*? dunno
2021-04-25 15:35:00 × supercoven quits (~Supercove@dsl-hkibng31-58c384-213.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-04-25 15:35:03 <hpc> rust is almost functional, it just needs to be easier to get lambdas to play nicely with ownership
2021-04-25 15:35:16 waleee-cl joins (uid373333@gateway/web/irccloud.com/x-boxlsxrcosxlqwrv)
2021-04-25 15:35:20 supercoven joins (~Supercove@dsl-hkibng31-58c384-213.dhcp.inet.fi)
2021-04-25 15:35:25 <hpc> really the one thing i miss is purity - or rather, first-class IO
2021-04-25 15:36:19 <SoF> I just want a compiler for English
2021-04-25 15:36:28 <SoF> monkey's paw-like
2021-04-25 15:36:43 <SoF> if you're not specific enough, the binary will just delete your / or something
2021-04-25 15:37:16 <maerwald> I haven't missed monads at all when doing rust. Instead it has ad-hoc functions like `and_then`
2021-04-25 15:37:16 <gnumonic> i legitimately do not know how people can write programs without ADTs and pattern matching. (maybe that's just cuz I wrote like 100k lines of haskell before looking at any other languages)
2021-04-25 15:37:36 <maerwald> hpc: rust is not based on lambda calculus, so it isn't functional
2021-04-25 15:38:08 <ammar2> that's a very purist definition...
2021-04-25 15:38:12 <maerwald> yes
2021-04-25 15:38:19 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2021-04-25 15:38:23 <SoF> gnumonic: recently wrote some Go code and I *really* missed ADTs + pattern matching...
2021-04-25 15:38:25 <ammar2> almost to the point of being useless when talking about languages
2021-04-25 15:38:33 <maerwald> not at all
2021-04-25 15:38:36 <DigitalKiwi> i think hpc has one a good job of supporting my point lol
2021-04-25 15:38:41 <__minoru__shirae> it's interesting how would you translate ownership to fp
2021-04-25 15:39:01 <maerwald> just because you can write *pure* functions in a language, doesn't make it a pure language, for instance

All times are in UTC.