Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Daniel Fischer
Am Samstag 01 Mai 2010 00:58:23 schrieb Felipe Lessa: > > It depends on what is on your scope: > > Prelude> :t Data.Text.Lazy.IO.readFile > Data.Text.Lazy.IO.readFile > > :: FilePath -> IO text-0.7.1.0:Data.Text.Lazy.Internal.Text > > Prelude> :m Data.Text.Lazy > Prelude Data.Text.Lazy>

Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Felipe Lessa
On Fri, Apr 30, 2010 at 11:09:05PM +0200, Daniel Fischer wrote: > Hmm, > > Prelude> :t Data.Text.Lazy.IO.readFile > Data.Text.Lazy.IO.readFile > :: FilePath -> IO text-0.7.1.0:Data.Text.Lazy.Internal.Text > Prelude> :t Data.Text.IO.readFile > Data.Text.IO.readFile > :: FilePath -> IO text-0.7.1

Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Daniel Fischer
Am Samstag 01 Mai 2010 00:26:26 schrieb Bryan O'Sullivan: > On Fri, Apr 30, 2010 at 3:14 PM, Daniel Fischer wrote: > > Yes, I understood it so that he wanted to convert from > > Data.Text.Lazy.Internal.Text to Data.Text.Lazy.Text. > > It's the same type. That's why I suggested id. ___

Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Bryan O'Sullivan
On Fri, Apr 30, 2010 at 3:14 PM, Daniel Fischer wrote: > > Yes, I understood it so that he wanted to convert from > Data.Text.Lazy.Internal.Text to Data.Text.Lazy.Text. > It's the same type. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://

Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Daniel Fischer
Am Freitag 30 April 2010 23:20:59 schrieb Edward Kmett: > On Fri, Apr 30, 2010 at 5:09 PM, Daniel Fischer wrote: > > and how can I get from internal type to regular type when using > > > > > Data.Text? > > > > Use id :: a -> a > > ;) > > > > Not quite, there is still a distinction between > > Data

Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Edward Kmett
On Fri, Apr 30, 2010 at 5:09 PM, Daniel Fischer wrote: > and how can I get from internal type to regular type when using > > > Data.Text? > > Use id :: a -> a > ;) > > Not quite, there is still a distinction between Data.Text(.Internal).Text and Data.Text.Lazy(.Internal).Text. but the machinery to

Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Bryan O'Sullivan
On Fri, Apr 30, 2010 at 1:37 PM, Thomas Hartman wrote: > > why does the lazy version use the internal type, whereas the strict > version of Text IO just using plain Data.Text type? > That's just ghci playing display games with you, based on the names under which you imported the modules. There

Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Daniel Fischer
Am Freitag 30 April 2010 22:37:38 schrieb Thomas Hartman: > *Main> :t Data.Text.IO.readFile > Data.Text.IO.readFile :: FilePath -> IO T.Text > > but > > *Main> :t Data.Text.Lazy.IO.readFile > Data.Text.Lazy.IO.readFile > > :: FilePath -> IO text-0.7.1.0:Data.Text.Lazy.Internal.Text > Hmm, Prelu

Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Edward Kmett
Data.Text.Lazy.Internal.Text = Data.Text.Lazy.Text Data.Text.Internal.Text = Data.Text.Text You can use fromChunks/toChunks from Data.Text.Lazy to break it up into strict Text fragments. The lazy version returns a Lazy Text value, which is isomorphic to [Data.Text.Text]. The strict version just r

[Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Thomas Hartman
*Main> :t Data.Text.IO.readFile Data.Text.IO.readFile :: FilePath -> IO T.Text but *Main> :t Data.Text.Lazy.IO.readFile Data.Text.Lazy.IO.readFile :: FilePath -> IO text-0.7.1.0:Data.Text.Lazy.Internal.Text why does the lazy version use the internal type, whereas the strict version of Text IO