[Haskell-cafe] Binary code

2006-11-27 Thread escafia
Hi, i've one fuction receiving an int . The objective is return the respective binary code of that int. For example, if i receive 28 the fuction will return 011100. My question is that there is any fuction in libraries that do this? If not, anyone has any suggestion? Thank you. -- View this

Re: [Haskell-cafe] Binary code

2006-11-27 Thread J. Garrett Morris
Hello, First, and forgive me if I'm making unwarranted assumptions, but http://haskell.org/haskellwiki/Homework_help might be useful. Second: div, mod, reverse, and the unfoldr function from Data.List will do what you want. /g On 11/25/06, escafia [EMAIL PROTECTED] wrote: Hi, i've one

Re: [Haskell-cafe] Binary code

2006-11-27 Thread Valentin Gjorgjioski
On 28.11.2006 01:20 J. Garrett Morris wrote: Hello, First, and forgive me if I'm making unwarranted assumptions, but http://haskell.org/haskellwiki/Homework_help might be useful. Second: div, mod, reverse, and the unfoldr function from Data.List will do what you want. /g On 11/25/06, escafia

Re: [Haskell-cafe] Binary code

2006-11-27 Thread Stefan O'Rear
On Mon, Nov 27, 2006 at 06:20:15PM -0600, J. Garrett Morris wrote: First, and forgive me if I'm making unwarranted assumptions, but http://haskell.org/haskellwiki/Homework_help might be useful. On 11/25/06, escafia [EMAIL PROTECTED] wrote: i've one fuction receiving an int . The objective is

Re: [Haskell-cafe] Binary code

2006-11-27 Thread Mark T.B. Carroll
escafia [EMAIL PROTECTED] writes: Hi, i've one fuction receiving an int . The objective is return the respective binary code of that int. For example, if i receive 28 the fuction will return 011100. In GHCi, Prelude Numeric.showIntAtBase 2 (head . show) 28 $ 11100 My question is that

Re: [Haskell-cafe] Binary code

2006-11-27 Thread Donald Bruce Stewart
trevion: Hello, First, and forgive me if I'm making unwarranted assumptions, but http://haskell.org/haskellwiki/Homework_help might be useful. Yes, almost certainly this is the case. The same questions were asked on #haskell at pretty much the same time... 15:54:34 --- join: