Adding to Francesco's reply, UTCTime is not a String either. Luckily, it does have a Show instance however, which means you probably want something like:

    getDateString = do
        date <- getCurrentTime
        return $ show date

Or, more simply: getDateString = fmap show getCurrentTime

You will still need to use bind, fmap, or do to get at the actual date string however.

Thanks,
Arjun

On Thu, Nov 10, 2016 at 1:58 PM Francesco Ariis <fa-ml@ariis.it> wrote:
On Thu, Nov 10, 2016 at 07:44:17PM +0100, sasa bogicevic wrote:
> Hi All,
>
> This is a small program
>
> [...]

Hey Sasa,
If we put this into ghci

    λ> :t formatDateString $ timeFromString _

the "hole" tells us we need something of type String, but `getDateString`
is not!

    λ> :t getDateString
    getDateString :: IO UTCTime

That means you have to bind it inside a `do` block (or use >>=).
Ask for more if I was not clear!
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners