this is what I'm actually trying to do
slHelper :: Double -> ((Double, Int) -> (Double, Int))
slHelper x = ((x + ), (1 + )) -- ERROR
this is what I'm actually trying to do
slHelper :: Double -> ((Double, Int) -> (Double, Int))
slHelper x = ((x + ), (1 + )) -- ERROR
#haskell beginner question
I can create a function (2*) and apply it to 5:
(2*) 5
10
---
I can create a (1 +) and apply it to 6:
(1 + ) 6
7
--
but how to I create a function that applies to the tuple (5,6) ?
((2 *), (1 +)) (5,6)
ERROR
---
I can do this
(\(x,y) -> ((2 * x), (1 + y))) (5,6)
(10,7)
but I want a "partial" function that I can use in a foldr eg folder (2 * ) 1 xs
learning #haskell ...
.. my brain is being stretched by having to compose functions made of partial functions .. not just one .. but several levels of them!
mathematically it is perfectly sound, but my brain is not yet trained to read code with functions made of functions made of functions, many of which appear to have missing arguments
it's a good challenge !
I’m interested in seeing Fedi’s opinion on this. Also reply with a more detailed opinion and your language of choice if you feel so inclined. Boost if you are interested in this too.
When my compiler reports an error, I most often see this as:
#haskell users: if you're using stack and you choose to switch your resolver to say, be compatible with HLS (Haskell Language Server), then be sure to run `stack clean`--this messed with me for a long time...
Question for Haskell folks:
I have an odd issue with discrepancy between ghc and ghci behavior with respect to hmatrix (with everything installed via the system package manager on Debian sid+experimental). ghc works just fine, but within ghci, lapack throws an undefined symbol error for literally anything. Has anyone else run into this?
I am in urgent job search mode, so I'm gonna throw this out here and see if anything comes of it.
I am a #Canadian, fluent in both #English and #French. I have experience with several programming languages. My strongest proficiency is with #Haskell and #C. I also have a reasonable grasp of #HTML, #JavaScript, #SQL, #Python, #Lua, #Linux system administration, #bash scripting, #Perl, #AWK, some #Lisp (common, scheme, and emacs), and probably several others I've forgotten to mention.
I am not necessarily looking for something in tech. I just need something stable. I have done everything from software development, to customer support, to factory work, though my current circumstances make in-person work more difficult than remote work. I have been regarded as a hard worker in every job I have ever held.
a #haskell exercise has me puzzled:
What is the C/Java/Python equivalent of the Haskell expression
send metric (double population + increase)?
---
A send(metric(double(population+increase)))
B send(metric(double(population)+increase))
C send(metric,double(population)+increase)
D send(metric,double(population+increase))
It isn't A or D because (double population + increase) is double(population) +...
answer is C but why can't it be B .. where metric is a function taking one argument?
#haskell beginner here.
Is there a "natural number" type so I can use Nat and not Int which is technically incorrect (based on a textbook example)
myrep :: Int -> b -> [b]
myrep 1 x = [x]
myrep n x = x : myrep (n - 1) x
just started learning #haskell
the exercise wants us to return undefined for divisor zero
divTuple :: (Eq a, Fractional a) => (a, a) -> a
divTuple (x, y)
| y == 0 = undefined
| otherwise = x / y
but when I run it, I seem to get an "crash" rather than a value of type undefined:
ghci> divTuple (4,0)
*** Exception: Prelude.undefined
CallStack (from HasCallStack):
undefined, called at 04-syntax-in-functions.hs:21:16 in main:Main
is this right?
I'm only just starting to learn #haskell
I've today come across "type inference" where it works out the type of a thing by how you use it.
I saw it in #Lean too with #implicit types".
Anyway - my brain is worrying that this is not a foolproof system and the languages should never have allowed it.
Am I wrong to worry?
just started learning #haskell
why does the VSC linter complain about infix vs prefix?
I didn't think it was a serious matter?
----
Found:
elem c ['A' .. 'Z']
Why not:
c `elem` ['A' .. 'Z']
US to limit Canadian access to built on border Haskell Free Library & Opera House
@jeremy_list
lineage tracing eg discussion
hey I wanted to relate #lisp and #haskell so I was looking at your #gopher example from before:
gopher://thunix.net/0/~jeremylist/lineage.hs
or for the ungopherful
https://portal.mozz.us/gopher/thunix.net/0/~jeremylist/lineage.hs
Is this lisp a good match for what you did?
(defun f-rassoc (child ancestor family)
(let ((person (rassoc ancestor family :test 'member)))
(when person
(if (equal (car person) child) T
(f-rassoc child (car person) family)))))
US government blocks Canadian access to border-straddling library
https://communitymedia.video/w/968LULd4gdi98BRLBDQ37E #interview with #gopher @someodd #haskell #technology #podcast featuring some #lisp #symbolics #reminiscences
gopher://gopher.someodd.zip
https://www.someodd.zip
someodd starting points
Connection was a bit spotty so we talked over each other occasionally. I forgot to boost the show toot, so if you would like to boost here that would be appreciated.
Feedback about the interview and interviews generally are welcome and wanted here.
#lispyGopherClimate #archived https://communitymedia.video/videos/watch/41809e84-ea6e-43f9-ba06-5092114391fa #gopher #technology #podcast #lisp
complete archive peertube
#climateCrisis #haiku from @kentpitman thanks as always!
#interview with exceptionally #libre #gopher @someodd gopher://gopher.someodd.zip and #haskell #programmer . They run a lot of libre services as well. As always questions, boosts welcome
Chat in #lambdaMOO as always
telnet lambda.moo.mud.org 8888
co guest
@join screwtape
#gopher #lispyGopherClimatet #notTheShowToot
@someodd confirmed #interview in a few hours. #gopher questions, #Haskell questions and comments I guess, #libre #service questions and comments from anyone ...? We'll be live in #lambdaMOO as always.