Questions tagged [miranda]

Miranda is a pure, non-strict, polymorphic, higher order functional programming language.

For more information, see the Miranda homepage.

21 questions
1
vote
2 answers

Haskell: Split a list using list comprehension

How do you split a list into halves using list comprehension? e.g. If I have [1,1,2,2,3,3,4,4,5,5] and I only want [1,1,2,2,3] my attempts so far: half mylist = [r | mylist!r ; r <- [0..(#mylist div 2)] ] ||does not work Any thoughts? [Nb: This…
tetris11
  • 817
  • 2
  • 11
  • 27
0
votes
4 answers

Miranda going through lists

is there an easy way to go through a list? lets say i wanted to access the 5th data on the list not knowing it was a B ["A","A","A","A","B","A","A","A","A"] is there a way i can do it without having to sort through the list?
user23012
  • 219
  • 2
  • 16
0
votes
2 answers

Miranda Language - Function lambda

I have been studying the functional paradigm for some time and in this period I made some successes and several mistakes and it was with those mistakes where I really learned the most. I believe that a good way to learn a computational paradigm is…
0
votes
3 answers

Pattern matching simple types

I am a beginner trying to learn functional programming. Is there a way to pattern match different standard (not user defined) types? E.g. if the argument of the function is a tuple, add them, if it is just an int, use int: form (x, y) = x + y form…
sandboxj
  • 1,234
  • 3
  • 21
  • 47
0
votes
1 answer

Can't open Miranda programming language tar ball Mac El Capitan

I'm trying to: sudo tar xpzf mira-2044-x86_64-Darwin.tgz -C / I am in the correct directory (my Downloads folder) but I get this error: ./usr/: Can't set user=0/group=0 for usrCan't update time for usr tar: Error exit delayed from previous…
Soluble Snake
  • 73
  • 1
  • 12
0
votes
1 answer

How do I determine the data type for a program?

I'm trying to study for an exam, and I feel that the lecture slides confuse me a bit. One of our test questions will likely be "What is the type of program programName", but I have trouble grasping the concept. I understand what data types are, but…
Jake
  • 71
  • 1
  • 7
1
2