Re: Help

2002-02-25 Thread Juan M. Duran

Hi, I'm writting a small parser in Haskell and, when it is all done, I get
the following problem: Type Binding.

The thing is, I have 3 main functions:
1) Read the file, its type is: [Char] -IO [Char] (see InputOutput.hs)
2) Parse a string (using words and readDec), its type is: Integral a =
[Char] - [a] (see Parse.hs)
3) Parse a list of integer, its type is: [Float] - [[Float]]
(Functions.hs)

Now the problem is that I cannot run the first function, then use its
results as an input of the second function and, finally, its results as
the input of the third function.

How can I fix this without modifing all my functions because they,
independly, works fine.

Juan
 


From [EMAIL PROTECTED] Thu Feb 14 16:53:00 2002
Date: 08 Feb 2002 15:21:41 -0300
From: Maxi Combina [EMAIL PROTECTED]
To: Juan M. Duran [EMAIL PROTECTED]
Subject: Re: Problems

ya deberiamos cambiar el subject, no?
pero asi esta bueno!

El jue, 07-02-2002 a las 09:37, Juan M. Duran escribió:
 Antes que me olvide, necesito:
 - La cancion que hicimos (quiero que la lea la Cari)
bueno, te la adjunto (es un .doc).
fijate que la acabo de abrir con soffice (si, porque el modem desde win
no quiere andar mas... te acordar que ya el año pasado te habia
preguntado por el asunto? resulta que cuando uno reinstala win, no
quiere andar. tenes que renegar un monton hasta que de algun modo
empieza a andar)
Bueno, el punto que el soffice no me muestra el ultimo renglon de la
cancion. No se si él lo ve mal o si realemente no esta. Por las dudas te
mando la ultima estrofa (que incluye --obviamente-- el último renglon:

Un consejo muy piola
queremos darte
no vengas a este lugar
a congelarte


 - El temita ese del mp3 en linux, recuerda?, bueno, me diste un executable
 que no se que hacia (algo con la dma), bueno, ese ejecutable no existe,
 por lo menos en mi computador.
ops, entonces no sera eso. de todos modos, ese ejecutable esta muy bueno
para modificar el comportamiento del duro. es parte de un paquete que se
llama hdparm (asi tambien se llama el ejecutable). en tu cd de mdk 8.0
seguro que esta, sino, en la red.


 - Me estan ensenhando a tocar la guitarra, estoy realmente practicando y
 me gusta, ya se algunos acordes, los basicos vio (Do, Re, Mi, Sol, La) y
 ni siquiera son todos, je je. En fin, te acordas cuando me dabas clases,
 habias dicho que existia algo (no se, creo que era #) que era
 indempotente, si te acordas decimelo porque estoy meta y meta discutir con
 cari sobre eso, solo que no recuerdo lo que era. AH, si tenes los acordes
 de alguna cancion conocida por mi y que sea facil, mandalo.
no, idempotente no era, ya que un operador idempotene (llamemosle E)
tiene la propiedad de que EoE=E (lease E compuesto con E igual a E).
Ese bicho que decis (#) es el sostenido. Provoca que la nota a la cual
se le aplique se eleve en 1/2 tono. A ver: la nota Do es la nota Do y
punto. La nota #do es do + 1/2 tono. Si se trata de un acorde (conjunto
de notas), entonces el # provoca que todas sus notas se eleven 1/2 tono.
Por ejemplo: el acorde DO mayor esta compuesto por 3 notas: do, mi y sol
por lo tanto, #DO sera: do#, fa y sol# (notar que no puse #mi, ya que
#mi=fa) (notar que en minusculas estan las notas y en mayusculas los
acordes)

El complemento de # es el bemol (no me da el teclado para dibujarlo). Lo
que hace el bemol es restar 1/2 tono en vez de sumar.

El # y el bemol son aditivos, i.e., ##do=#(#do)=do + 1/2 tono + 1/2
tono=re.
por ejemplo: #(bemol)do=do - 1/2 tono + 1/2 tono=do
bemol(fa)=fa - 1/2 tono = mi

ah, ésta es la tabla de notas (se indica en terminos de #):

do #do re #re mi fa #fa sol #sol la #la si do

notar  que todos tienen # salvo mi (ya que #mi=fa) y si (pues #si=do)


Antes de mandarte una cancion, te mando la notacion usual (se llama
notacion americana, creo). La idea es no escribir tanto (DO mayor, RE
menor, etc son demasiadas letras).
Primero, una tabla de equivalencia: (by heart, man)

DO = C
RE = D
MI = E
FA = F
SOL = G
LA = A
SI = B

Si ponemos C sin ningun aditivo, entonces es un DO mayor,.
para indica el menor (DO menor), ponemos Cm.
La septima: C7
Cambiar el bajo: D/F# (esto es, RE con bajo #FA)
etc


Una cancion facil: acabo de sacar losing my religion:
Intro: F - Am - F - AM - G

(no sé la letra)

estrofa: Am - Em un par de veces (no se cuantas exactamente)
Dm - G - Am

bueno, escuchala.

una mas facil:

Mujer amante:
=

NOTACION= entre parentesis el acorde adecuado en el momento adecuado ;-)
Intro: la obviamos, no calienta.

Empezar en Bm

Siento el calor de toda tu (G) piel en mi cu(A)erpo otra vez

Est(Bm)rella fugaz enci(D)ende mi (A) sed, misteriosa mujer

por tu  am(G)or sensual cuanto me (Bm)das?

Haz que mi (A) sueño (Em) sea un(D)a verdad

dame tu (G) alma hoy hacia el ri(Bm)tual

Llévame al (A) mundo (Em) donde (F#) pueda sonñar



(Bm)U (D)debo saber si es (A)verdad

Re: Help

2002-02-25 Thread Juan M. Duran

I thing that wont works, look:
 contents :: IO [Char]

 parser :: Integral a = [Char] - [a]

 control :: [Float] - [[Float]]

 The two problems are:
   1) The input of parser. Doesnt match with the type of input
   2) The input of control (or the output of parser). Doesn match
 with the type of the next function.

On Mon, 25 Feb 2002, Rijk J. C. van Haaften wrote:

 You probably want to do something like this:
 
 main =
  do {
  contents - input twoboxes.dat
  return (control (parser contents))
  }
 
 At 11:53 25-02-02 -0300, Juan M. Duran wrote:
 Hi, I'm writting a small parser in Haskell and, when it is all done, I get
 the following problem: Type Binding.
 The thing is, I have 3 main functions:
 1) Read the file, its type is: [Char] -IO [Char] (see InputOutput.hs)
 2) Parse a string (using words and readDec), its type is: Integral a =
 [Char] - [a] (see Parse.hs)
 3) Parse a list of integer, its type is: [Float] - [[Float]]
 (Functions.hs)
 
 Now the problem is that I cannot run the first function, then use its
 results as an input of the second function and, finally, its results as
 the input of the third function.
 
 How can I fix this without modifing all my functions because they,
 independly, works fine.
 
 Juan
 
 

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Help

2002-02-22 Thread Juan M. Duran

Hi, I need to parse a string to a list of integer, like this:

12 32\n15

to

[12,32,15...]

f :: String - [Int]

What I´ve found is the function words which does 

words :: String - [String]

it is in the Prelude.hs

then if I have something like 12 32\n15... with words I get
[12,32,15...]

which is cool but not exactly what I need. Would you help me?

Thanks

J.


Porque la única lucha que se pierde, es la que se abandona,
¡Ni un paso atrás!


___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Help

2001-11-19 Thread Juan M. Duran

Hi, I am developing a software based on Genetic Programming and I am
trying that this soft makes source code in Haskell. 
I've two problems, one is that I only count on The Haskell report and I
need more information about haskell's available library.
On the other hand, I need to read a file and (as in imperative
programming) get each word the file has because they are parameters for
future functions.

Thanks

Juan

PS: Here is some code I made:

import IO

arch = twoboxes.dat
mode = ReadMode

main = do {handler - openFile arch mode; 
 contents - hGetContents handler; 
 putStr contents; hClose handler }

putList :: a - [a] - [a]
putList x [] = [x]
putList x xs = x:xs



___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell