Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-13 12:36:47 <lambdabot> ap
2021-04-13 12:38:38 _bin joins (~bin@2600:1700:10a1:38d0:8028:8b86:7e11:f5b5)
2021-04-13 12:40:50 <ddk> ?
2021-04-13 12:41:33 <merijn> You should figure out how you want/have to store things in postgres and then find out how to use that using postgres-simple, I'd say?
2021-04-13 12:42:33 <merijn> Seems to me the Database.PostgreSQL.Simple.Time has more than you'd ever want to know on the topic?
2021-04-13 12:42:52 <merijn> Also: Don't store future times in UTC
2021-04-13 12:45:19 <ddk> merijn: using `TIMESTAMP WITH TIME ZONE` in postgres, I'm not sure whether I can directly parse them in Haskell
2021-04-13 12:45:42 ddellacosta joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-04-13 12:45:56 hannah58 joins (546babef@84-107-171-239.cable.dynamic.v4.ziggo.nl)
2021-04-13 12:46:02 × malumore__ quits (~malumore@151.62.122.89) (Remote host closed the connection)
2021-04-13 12:46:08 × gzj quits (~gzj@unaffiliated/gzj) (Read error: Connection reset by peer)
2021-04-13 12:46:15 malumore joins (~malumore@151.62.122.89)
2021-04-13 12:46:27 × malumore quits (~malumore@151.62.122.89) (Remote host closed the connection)
2021-04-13 12:46:29 gzj joins (~gzj@unaffiliated/gzj)
2021-04-13 12:46:34 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-13 12:47:44 × hannah58 quits (546babef@84-107-171-239.cable.dynamic.v4.ziggo.nl) (Client Quit)
2021-04-13 12:47:46 malumore joins (~malumore@151.62.122.89)
2021-04-13 12:47:56 kritzefitz joins (~kritzefit@2003:5b:203b:200::10:49)
2021-04-13 12:49:06 × malumore quits (~malumore@151.62.122.89) (Remote host closed the connection)
2021-04-13 12:49:33 × rprije quits (~rprije@59-102-63-15.tpgi.com.au) (Ping timeout: 240 seconds)
2021-04-13 12:49:57 × Mrbuck quits (~Mrbuck@gateway/tor-sasl/mrbuck) (Ping timeout: 240 seconds)
2021-04-13 12:50:13 × tomsmeding quits (~tomsmedin@tomsmeding.com) (Quit: ZNC 1.8.2 - https://znc.in)
2021-04-13 12:51:12 malumore joins (~malumore@151.62.122.89)
2021-04-13 12:51:18 tomsmeding joins (~tomsmedin@tomsmeding.com)
2021-04-13 12:51:19 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
2021-04-13 12:54:41 ircbrowse_tom joins (~ircbrowse@64.225.78.177)
2021-04-13 12:54:41 Server sets mode +CLnt
2021-04-13 12:56:05 hyperisco joins (~hyperisco@d192-186-117-226.static.comm.cgocable.net)
2021-04-13 12:58:06 × alexm_ quits (~alexm_@161.8.254.229) (Remote host closed the connection)
2021-04-13 13:02:39 Komrad_Kafuka joins (cbd4caba@203.212.202.186)
2021-04-13 13:02:55 <Komrad_Kafuka> Hi
2021-04-13 13:03:11 × Major_Biscuit quits (~Major_Bis@wlan-145-94-219-47.wlan.tudelft.nl) (Ping timeout: 240 seconds)
2021-04-13 13:04:11 × jules_ quits (~jules@ip201.ip-135-125-227.eu) (Ping timeout: 240 seconds)
2021-04-13 13:04:32 carlomagno joins (~cararell@148.87.23.8)
2021-04-13 13:05:07 × ddk quits (9d2a7d60@157.42.125.96) (Quit: Connection closed)
2021-04-13 13:05:14 jules_ joins (~jules@ip201.ip-135-125-227.eu)
2021-04-13 13:05:19 <Komrad_Kafuka> I've been recently learning haskell and it's a little hard but great. I was writing some code for evaluating e^x but it's giving me an error I can't understand , can I share it with you guys?
2021-04-13 13:06:20 <hyperisco> yes
2021-04-13 13:06:27 <merijn> I'm pretty sure I know the issue without seeing it ;)
2021-04-13 13:06:42 <merijn> Probably the difference between
2021-04-13 13:06:45 <merijn> :t (**)
2021-04-13 13:06:47 <lambdabot> Floating a => a -> a -> a
2021-04-13 13:06:48 <merijn> :t (^)
2021-04-13 13:06:49 <lambdabot> (Integral b, Num a) => a -> b -> a
2021-04-13 13:06:50 <merijn> :t (^^)
2021-04-13 13:06:52 <lambdabot> (Fractional a, Integral b) => a -> b -> a
2021-04-13 13:07:09 × gzj quits (~gzj@unaffiliated/gzj) (Read error: Connection reset by peer)
2021-04-13 13:07:29 gzj joins (~gzj@unaffiliated/gzj)
2021-04-13 13:07:42 <Komrad_Kafuka> {-# LANGUAGE FlexibleInstances, UndecidableInstances, DuplicateRecordFields #-}
2021-04-13 13:07:43 <Komrad_Kafuka> module Main where
2021-04-13 13:07:43 <Komrad_Kafuka> import Control.Monad
2021-04-13 13:07:44 <Komrad_Kafuka> import Data.Array
2021-04-13 13:07:44 <Komrad_Kafuka> import Data.Bits
2021-04-13 13:07:44 <Komrad_Kafuka> import Data.List
2021-04-13 13:07:45 <Komrad_Kafuka> import Data.List.Split
2021-04-13 13:07:45 <Komrad_Kafuka> import Data.Set
2021-04-13 13:07:46 × justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Quit: WeeChat 2.9)
2021-04-13 13:07:46 <Komrad_Kafuka> import Debug.Trace
2021-04-13 13:07:47 <Komrad_Kafuka> import System.Environment
2021-04-13 13:07:47 <Komrad_Kafuka> import System.IO
2021-04-13 13:07:47 <Komrad_Kafuka> import System.IO.Unsafe
2021-04-13 13:07:48 <Komrad_Kafuka> factorial :: Double -> Double
2021-04-13 13:07:48 <Komrad_Kafuka> factorial 0 = 1
2021-04-13 13:07:49 <Komrad_Kafuka> factorial x = x * factorial x - 1
2021-04-13 13:07:49 <Komrad_Kafuka> pow :: Double -> Integer -> Double
2021-04-13 13:07:50 <Komrad_Kafuka> pow _ 0 = 1.000 :: Double
2021-04-13 13:07:50 <Komrad_Kafuka> pow 0 _ = 0.000 :: Double
2021-04-13 13:08:04 <Komrad_Kafuka> Here's the error
2021-04-13 13:08:05 <Komrad_Kafuka> Solution.hs:27:41: error:
2021-04-13 13:08:06 <Komrad_Kafuka>     • Couldn't match expected type ‘Double’ with actual type ‘Integer’
2021-04-13 13:08:06 <Komrad_Kafuka>     • In the first argument of ‘factorial’, namely ‘count’
2021-04-13 13:08:07 <Komrad_Kafuka>       In the second argument of ‘(/)’, namely ‘(factorial count)’
2021-04-13 13:08:07 <Komrad_Kafuka>       In the first argument of ‘(+)’, namely
2021-04-13 13:08:08 <Komrad_Kafuka>         ‘(pow x count) / (factorial count)’
2021-04-13 13:08:08 <Komrad_Kafuka>    |
2021-04-13 13:08:09 <Komrad_Kafuka> 27 | eval x count = (pow x count)/(factorial count) + (eval x count - 1)
2021-04-13 13:08:09 <Komrad_Kafuka>    | ^^^^^
2021-04-13 13:08:10 <Komrad_Kafuka> Solution.hs:36:9: error:
2021-04-13 13:08:10 <Komrad_Kafuka>     • Couldn't match expected type ‘Double -> Integer -> IO b0’
2021-04-13 13:08:11 <Komrad_Kafuka>                   with actual type ‘IO ()’
2021-04-13 13:08:11 <Komrad_Kafuka>     • The function ‘print’ is applied to three arguments,
2021-04-13 13:08:12 <Komrad_Kafuka>       but its type ‘(Double -> Integer -> Double) -> IO ()’ has only one
2021-04-13 13:08:12 <Komrad_Kafuka>       In a stmt of a 'do' block: print eval x 0
2021-04-13 13:08:13 <Komrad_Kafuka>       In the expression:
2021-04-13 13:08:13 <Komrad_Kafuka>         do x <- readLn :: IO Double
2021-04-13 13:08:14 <Komrad_Kafuka>            print eval x 0
2021-04-13 13:08:14 <Komrad_Kafuka>    |
2021-04-13 13:08:52 × Pickchea quits (~private@unaffiliated/pickchea) (Ping timeout: 265 seconds)
2021-04-13 13:09:09 × gzj quits (~gzj@unaffiliated/gzj) (Remote host closed the connection)
2021-04-13 13:09:09 <ski> @where paste
2021-04-13 13:09:10 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
2021-04-13 13:09:29 gzj joins (~gzj@unaffiliated/gzj)
2021-04-13 13:09:39 <ski> Komrad_Kafuka : please use a paste site (like e.g. that ^ above), next time -- don't paste huge amounts of lines into the channel
2021-04-13 13:10:06 <Komrad_Kafuka> Sure, sorry about that
2021-04-13 13:10:10 × gzj quits (~gzj@unaffiliated/gzj) (Read error: Connection reset by peer)
2021-04-13 13:10:21 <ski> (i was actually surprised you weren't automatically K-lined by Sigyn for doing that .. but now i notices Sigyn's gone missing, for whatever reason)
2021-04-13 13:10:30 gzj joins (~gzj@unaffiliated/gzj)
2021-04-13 13:10:33 × Rudd0 quits (~Rudd0@185.189.115.108) (Ping timeout: 240 seconds)
2021-04-13 13:10:52 <Komrad_Kafuka> https://paste.tomsmeding.com/VGuP7TtX
2021-04-13 13:11:38 <Komrad_Kafuka> ski yeah I did not get any message at first, here's the link

All times are in UTC.