Prove Transitivity in Haskell semantics [closed] - haskell

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
I am learning semantics of Haskell and there I came across this question:
I have tried it but still unable to conclude the answer. It will be great if someone explains me how to prove this one. Thank you.

Just a sketch -> Since pn(s) for fixed n is morphism Ninf -> N , that is set of Integers into Integer, this proof can be simplified using this relation into proof of transitivity over integers
[1,0,0 .. ] -> [2,0,0 ..] -> [3,0,0 ..] -> ...
I am sure you can find even more interesting one

Related

Is the name of `liftM` inspired by lifts in mathematics? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I'm a math PhD student minoring in CS and currently taking a class in Haskell. We just learned about liftM.
The concepts seem similar but I haven't been able to figure out exactly how liftM can be thought of as a lift in the category-theoretical sense (I know very little category theory and was introduced to lifts in a Topology class).
Given the lack of activity -- and the lack of an obvious connection -- I think it's safe to say that liftM was not named because of its connection to topological and category-theoretic lifts.
Instead, I think the term "lift" has come to generically mean any transformation from one domain of reasoning to another, and it is this sense of "lift" that was the historical reason for the name liftM. Specifically: liftM transforms a pure function, "lift"ing it into the domain of a specific monad.

How to do string concatation to make a list [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Let I have two string. Say, "learn" and "haskell". How can make them list like ["learn","haskell"]
makeListFromTwoThings :: a -> a -> [a]
makeListFromTwoThings x y = [x,y]
Edit: I am assuming you want a function that does this generically. If you want to do this in the Haskell shell then it seems like nothing is stopping you from typing ["learn","haskell"] directly. If you are trying to solve some more general problem directly in the shell then let us know the details of that problem.

How can i fix the haskell hugs error Instance of Integral Bool required for definition of [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I am writing a haskell module for hugs and i get the error shown in the title.
What does this mean and how do i fix this?
the code in question is the second line
and1 :: [Bool] -> Bool
and1 [] = True
This is the first part of the module after the module declaration itself.
The error says that you're trying to use a Bool as an integral, a typeclass allowing most of the operations you'd expect to be on Integer. However, the code you've posted is error free.
Without the rest of the code this is impossible to diagonose. But did you perhaps add a space between and and 1? Eg and 1 [] = True

Determining whether one string is a cyclic rotation of another? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need to solve the following problem:
Give a linear-time algorithm to determine if a text T is a cyclic rotation of another string T'. For example, arc and car are cyclic rotations of each other.
I have no idea where to start. How can I solve this problem?
As a hint: if x and y have the same length, then x is a cyclic rotation of y iff x is a substring of yy. Try proving this and using this as the basis for your algorithm.
Hope this helps!

Naming of `pure` function in Control.Applicative [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
Why is the function for lifting a value into a functor named pure in Control.Applicative?
Think of pure as an adjective.
foo <*> pure 4 = foo applied on a pure value 4.
(As for the exact reason why it's called pure, probably only McBride and Paterson will know.)
It's a little like fromInteger. Its argument is always a pure value or function that will be lifted into the functor. Perhaps it should have been fromPure but you know how Haskell people love to shorten names (e.g. fst and snd instead of first and second...).

Resources