haskell-prelude Questions
3
Solved
Given a function like negate, it has the type signature:
negate :: Num a => a -> a
which I would describe as a being the type in the context of Num (correct me if you think I am wrong).
But ...
Pau asked 8/2, 2021 at 14:58
1
Solved
I wonder if someone is familiar with the Prelude´s read function in Haskell.
The type of this function is following.
Read a => String -> a
Can someone explain me with a few examples how this...
Bushweller asked 4/3, 2018 at 19:45
2
I look for something equivalent to what we can have in Python doing this::
>>> print([func for func in dir(__builtins__) if func[0].islower()])
['abs', 'all', 'any', 'ascii', 'bin', 'bool'...
Casuistry asked 2/8, 2017 at 14:24
1
Solved
If you want to fold a list, I see four ways to do it.
Fold from the right of the list, with the recursive term on the right
foldrr (-) 100 [1..10] = 1 - (2 - (3 - (4 - (5 - (6 - (7 - (8 - (9 -...
Ferris asked 2/7, 2017 at 8:54
4
Solved
I was reading the Haskell Prelude and finding it pretty understandable, then I stumbled upon the exponention definition:
(^) :: (Num a, Integral b) => a -> b -> a
x ^ 0 ...
Marielamariele asked 28/8, 2015 at 12:17
2
Solved
I am searching for a function which looks something similar to this:
withSelf :: (a -> b) -> a -> (a, b)
withSelf f x = (x, f x)
I have searched with Hoogle for such a function; I searc...
Guyton asked 29/3, 2015 at 17:15
3
Solved
I know
$ :: (a->b) -> a -> b
f $ x = f x
Intuitively it seems to me, like to say,
1. $ delays the evaluation of the function to its left
2. evaluates whats to its right
3. feeds...
Lofty asked 3/4, 2013 at 10:25
1
Is there a way to view a list of Prelude functions (such as Data.Char) from the Haskell console, instead of visiting Hoogle?
Versus asked 2/1, 2013 at 18:5
2
Solved
In one file I need to use the regular prelude (++) operator and I also wish to implement my own behaviour for (++). I have used import Prelude hiding (++) at the top of my file, defined my own (++)...
Hardware asked 6/11, 2011 at 22:20
1
© 2022 - 2024 — McMap. All rights reserved.