[Haskell-cafe] Simple List Question

2006-07-02 Thread Jenny678

Hello

Little Problem, hope that somebody can help me

I have a list 
main [(1,2,3),(4,5,6),(3,4,5)]

and i want all Elements at the 1. Pos.  in new List:
[1,4,3]

Thanks for help

-- 
View this message in context: 
http://www.nabble.com/Simple-List-Question-tf1880239.html#a5139831
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ACross

2006-06-19 Thread Jenny678

Hello,

Can somebody help me
My Problem is to define a code for:

cross 7 -- means 7*7
+++
++  ++
+  +  +  +
+++
+  +  +  +
++  ++
+++

Another Example
cross 13   -- 13*13   
+
++  ++
+  +  +  +
++  ++
+  +  +  +
++  ++
+  +  + 
++  ++
+  +  +  +
++  ++
+  +  +  +
++  ++
+

Can I use putString ???
Thanks for any help  

--
View this message in context: 
http://www.nabble.com/ACross-t1813549.html#a4943328
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Sets symmetric difference

2006-06-17 Thread Jenny678

Hello,

Know Somebody the code for symmetric difference (Sets)

examples

symmetric_difference [1..8][5..7] 
[1,2,3,4,8]

symmetric_ difference [1..8][] 
[1,2,3,4,5,6,7,8]

symmetric_ difference [1..12][10..20]  
[1,2,3,4,5,6,7,8,9,13,14,15,16,17,18,19,20]

Thanks for Help
--
View this message in context: 
http://www.nabble.com/Sets-symmetric-difference-t1805165.html#a4919646
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] putStrLn

2006-06-16 Thread Jenny678

Hello,

Can somebody help me

I want to work with putStrLn
main n = putStrLn *

for example 
How must I define the code that:
main 5
*


Thanks for any help
--
View this message in context: 
http://www.nabble.com/putStrLn-t1799896.html#a4905456
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] elementsinlist

2006-06-13 Thread Jenny678

Hallo
I search a code for 

elements_in_List([1,2],[1,2]). 
True
elements_in_List([1,8],[1,2,3,4,8]). 
True
elements_in_List([2,1],[1,2]). 
True
elements_in_List([1,1],[1]). 
False

I have a code
elements_in_List :: Eq a = [a] - [a] - Bool
elements_in_List [] _ = True
elements_in_List _ [] = False
elements_in_List (x:xs) (y:ys)
 | x == y = elements_in_List xs ys
 | True = elements_in_List (x:xs) ys

but it failed at 
elements_in_List([2,1],[1,2]). 
True

I hope somebody can help me 
Please don't use built-in-Functions.

Thanks for Help 


--
View this message in context: 
http://www.nabble.com/elementsinlist-t1782975.html#a4855615
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Problem in code

2006-06-06 Thread Jenny678

hello,
I can not find the problem, I use WinHugs and shows me(Syntax error in input
(unexpected keyword where). 
here is my code:

f :: (Float,Float) - Float
f (x,y) = (a(x,y) + 4) * (b(x,y) + 3)
where
a :: (Float,Float) - Float
a(x,y) = (x + y)*2
b :: (Float,Float) - Float
b(x,y) = (y - x)*5

How can I define this code with let in?
Thanks for any help.
--
View this message in context: 
http://www.nabble.com/Problem-in-code-t1742233.html#a4734684
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] changing out

2006-05-30 Thread Jenny678

hello,

i want to change my input integers

In 23 98
Out 98 23

I think its simple... sorry  my first steps in Haskell
thanks for solutions.
--
View this message in context: 
http://www.nabble.com/changing+out-t1707014.html#a4634189
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] swap a pair of integers

2006-05-29 Thread Jenny678

hello,
i want swap a pair of integers
for example
Main 17
out 71
Can somebody help me?
--
View this message in context: 
http://www.nabble.com/swap+a+pair+of+integers-t1700880.html#a4615989
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe