ertes 2017-03-05 08:45:18
that's what your fmap does: it takes a wave and attaches a *constant* second component
ertes 2017-03-05 08:45:55
but it's only constant in that particular point in time… in the next frame it will be a different constant that is attached to the whole wave
tsahyt 2017-03-05 08:47:08
that's what I've been reading from the types, and it's been a major source of confusion. But I suppose it really isn't what I want.
tsahyt 2017-03-05 08:47:20
when using the type synonym instead, this changes as far as I can see
ertes 2017-03-05 08:48:25
IMO you shouldn't use the type synonym either
ertes 2017-03-05 08:48:27
just use functions
tsahyt 2017-03-05 08:53:41
but that would be exactly the same semantically
tsahyt 2017-03-05 08:54:01
I'd just be giving a name to the most central thing in the library
ertes 2017-03-05 08:54:59
tsahyt: the main difference is that with WaveA's 'loop' you're using value recursion on *samples*, not *waves*
ertes 2017-03-05 08:56:05
which means: time becomes relevant, and you need to deal with waves *at each point in time*
tsahyt 2017-03-05 08:56:18
well now I'm confused again. this of course always gets used with a delay, which offsets a wave by 1 sample, providing a default value to fill the now empty start. when I want to determine the final value after some recursive transformation, I thought I'd want to recurse back over the samples
ertes 2017-03-05 08:57:15
you need to delay the WaveA, not the Wave… delaying the Wave is pointless, because the feedback value is constant over the whole wave
tsahyt 2017-03-05 08:57:46
that explains a lot
tsahyt 2017-03-05 08:58:37
how would I do that though? at this point I'm just asking to give me peace of mind.
tsahyt 2017-03-05 08:59:03
I've checked and there are no additional instances that I've defined on WaveA that don't exist on (->), so I guess I'll switch to that then
ertes 2017-03-05 08:59:47
ideally you wouldn't do it and just use value recursion normally, which means that you can delay the Wave: let w = f (delay w')
ertes 2017-03-05 08:59:54
whoops
ertes 2017-03-05 09:00:00
let w = f (delay w)
nbro 2017-03-05 09:06:40
Hi
nbro 2017-03-05 09:08:03
I've a question. I have a main module where I had not specified the IO action main was not defined and ghc was complaining about this
nbro 2017-03-05 09:08:16
but file is not really going to be used as a standalone app
davean 2017-03-05 09:08:37
nbro: then is it a library?
davean 2017-03-05 09:08:40
nbro: declare it as such
nbro 2017-03-05 09:08:43
so, in these cases, is there a conventional way to define IO main?
mauke 2017-03-05 09:09:01
what else are you going to use a main module for?
davean 2017-03-05 09:09:04
Either having an IO main makes sense or it doesn't
nbro 2017-03-05 09:09:06
well, the file name is lower case and it must remain like that (specifications)
mauke 2017-03-05 09:09:11
what
davean 2017-03-05 09:09:34
if its an executable it has an main, if its not it doesn't
davean 2017-03-05 09:09:50
the concept of an executable without a main is contradictory, without a main it can't be run
nbro 2017-03-05 09:09:58
I'm not saying that
nbro 2017-03-05 09:10:10
I'm not saying that I don't want to define main
nbro 2017-03-05 09:10:25
I'm just asking you how would you define it in my case
mauke 2017-03-05 09:10:34
I don't understand what "your case" is
davean 2017-03-05 09:12:26
nbro: "Not going to be used as a standalone app" <-- definitionally a library?`
nbro 2017-03-05 09:12:33
mauke: I didn't have the time to study more Haskell since the last time, but here's the thing… I understood that with main :: IO () we're defining the type of main
mauke 2017-03-05 09:13:06
yes
cocreature 2017-03-05 09:13:08
so you need to name your file main.hs but it can't be the main module?
nbro 2017-03-05 09:13:11
davean: not REALLY going to be used, sorry for not being precise enough
bollu 2017-03-05 09:13:21
does anyone know of a large-scale app that uses the free monad for DSL design pattern
nbro 2017-03-05 09:13:40
with that I mean that it can either simply be a file which is loaded into ghci
Tuplanolla 2017-03-05 09:13:42
You write `module Main where main = ...` into `Main.hs` and put the name of the executable you want in the Cabal file, nbro.
nbro 2017-03-05 09:13:47
or compiled
davean 2017-03-05 09:14:05
nbro: so ... don't definate it as the Main module, or don't tell GHC to compile it as a library
mauke 2017-03-05 09:14:07
ghc -c yourfile.hs IIRC
kuribas 2017-03-05 09:14:17
How can I stop the ghci debugger from entering an expression?
davean 2017-03-05 09:14:34
nbro: "loaded into GHCi but not run as an executable" is a type of library
nbro 2017-03-05 09:16:19
davean: yeah, but the point is that this an assignment and they have not specified if they are going to compile the file or simply load it in ghci, and this is the reason why I'm asking you "nonsensical" things
nbro 2017-03-05 09:16:35
so I was just wondering the best way according to you
nbro 2017-03-05 09:16:40
given my situation
kuribas 2017-03-05 09:16:49
If that's not possible the ghci debugger is pretty useless...
davean 2017-03-05 09:16:50
nbro: have it do whatever you want it to do?
Tuplanolla 2017-03-05 09:17:06
Contact the authors, nbro. We couldn't possibly guess.
monochrom 2017-03-05 09:17:39
"will load in ghci" does not resolve the ambiguity between library and executable.
davean 2017-03-05 09:17:53
nbro: either you have a thing you want main to do, or you don't. If you don't, don't define a main, its not an executable. If you do, define a main and declare it to do what you want.
monochrom 2017-03-05 09:18:05
For all you know they are going to enter ":main" which requires an executable-track file.
monochrom 2017-03-05 09:18:22
err, s/are/may be/
monochrom 2017-03-05 09:18:53
And then at some point you realize that it is a false dichotomy.
monochrom 2017-03-05 09:19:15
You go ask them "do you want main or not?" and code up accordingly.
nbro 2017-03-05 09:21:54
so, essentially, I want it to be compiled and at the same time I don't need it to be compiled
nbro 2017-03-05 09:22:19
I think
nbro 2017-03-05 09:22:52
Tuplanolla: if I use your method "module Main where main =" it says "parse error (possibly incorrect indentation or mismatched brackets)" while compiling
nbro 2017-03-05 09:23:07
I've indendented all lines of code and comments
davean 2017-03-05 09:23:10
nbro: Theres no problem compiling a file thats not an executable
nbro 2017-03-05 09:23:12
not sure why it still claims
davean 2017-03-05 09:23:19
nbro: are you missing a "do"?
mauke 2017-03-05 09:23:24
nbro: did you put something after the '='?
mauke 2017-03-05 09:23:38
because just 'main =' is a syntax error
monochrom 2017-03-05 09:23:46
Where can we read the assignment verbatim, and where can we read your code verbatim?
monochrom 2017-03-05 09:24:31
Statistics show that 80% of students overlook 20% of the assignment text. This is known as the 80-20 rule.
lpaste_ 2017-03-05 09:24:34
Tuplanolla pasted "Main Module" at http://lpaste.net/353244
nbro 2017-03-05 09:24:40
I know these problems are stupid and are due because I've still not learned
nbro 2017-03-05 09:24:45
but I didn't have time
ph88 2017-03-05 09:24:51
anyone know some good examples how to use holesOf, lastOf and filtered from lens ?
nbro 2017-03-05 09:24:53
so that's why a lot of stupid questions come here
mauke 2017-03-05 09:24:55
nbro: what does the assignment actually say?
nbro 2017-03-05 09:25:19
mauke: there are some exercises, it's not important
nbro 2017-03-05 09:25:23
the assignment is finished
mauke 2017-03-05 09:25:27
nbro: it is important
mauke 2017-03-05 09:25:37
since you're apparently struggling with it
mauke 2017-03-05 09:25:45
and not telling us what the constraints actually are
nbro 2017-03-05 09:25:55
mauke: not really
monochrom 2017-03-05 09:25:56
If it is finished, we can all go home now.
nbro 2017-03-05 09:26:07
Haskell is not difficult as people like to rate it
nbro 2017-03-05 09:26:10
IMO
nbro 2017-03-05 09:26:22
I simply just spent only 3 hours reading
nbro 2017-03-05 09:27:11
but I would have concrete questions, if you want to answer...
bollu 2017-03-05 09:27:22
nbro: haskell isn't hard, just different IMO
nbro 2017-03-05 09:27:30
yeah, indeed
bollu 2017-03-05 09:27:31
nbro: yes, go on, what is your question?
mauke 2017-03-05 09:27:37
I had a concrete question, but apparently you don't want to answer it
bollu 2017-03-05 09:27:41
nbro: it's just that it is _so different_ that it is mind bending :P
bollu 2017-03-05 09:27:57
nbro: I feel quite dumb 90% of the time with haskell and I love it ^_^
monochrom 2017-03-05 09:28:26
There was probably no assignment in the first place.
nbro 2017-03-05 09:28:51
usually you define a module as follows "module NameOfModule where …"
mauke 2017-03-05 09:29:10
haskell eschews assignments. it was probably a binding
bollu 2017-03-05 09:29:24
mauke: lol
nbro 2017-03-05 09:29:38
if it's main, I also need to set main, so in the case suggested by "Tuplenolla" he/she did "module Main where main = putStrLn "Works for me""
nbro 2017-03-05 09:31:47
my question is
nbro 2017-03-05 09:32:15
why exactly do we need to set main?
bollu 2017-03-05 09:35:08
nbro: what are you trying to do?
monochrom 2017-03-05 09:35:45
It is required for an executable.
hpc 2017-03-05 09:35:45
main is the thing that is run
hpc 2017-03-05 09:35:45
when you compile and run a haskell program
c_wraith 2017-03-05 09:35:45
nbro: it's the same thing as main in C
hpc 2017-03-05 09:35:45
(or just about any sort of program)
monochrom 2017-03-05 09:35:45
Similarly why do some python files have __main__? (Or whatever it's called.)
c_wraith 2017-03-05 09:35:45
nbro: you have to tell the compiler where the program starts *somehow*
hpc 2017-03-05 09:35:45
python executes in the top-level scope
bollu 2017-03-05 09:35:45
monochrom: that is quite different though
monochrom 2017-03-05 09:35:45
Ah OK.
nbro 2017-03-05 09:35:45
or another question would be: what kind o expressions (or statements?) are allowed to be in the main definition? Are there some restrictions?
c_wraith 2017-03-05 09:35:45
nbro: the convention is that it's the IO action named main in the module named main
hpc 2017-03-05 09:35:45
there's a magic __main__ variable in every scope that says if that's the module that's being executed
c_wraith 2017-03-05 09:35:45
err, the module is named Main
bollu 2017-03-05 09:35:45
monochrom: __main__ is used to control what happens when you import a module
c_wraith 2017-03-05 09:35:45
nbro: any value with a type unifying with IO a can be main
hpc 2017-03-05 09:36:05
i could probably go on for hours, but it wouldn't belong here and i have other things to do ;)
Tuplanolla 2017-03-05 09:37:21
When you don't, the world needs a Python critique that doesn't focus on indentation, hpc.
c_wraith 2017-03-05 09:37:46
I think anyone who's used python can provide that critique.
monochrom 2017-03-05 09:38:26
I only critique the official Python tutorial of using fibonacci in an example. :)
monochrom 2017-03-05 09:38:35
of? for?
c_wraith 2017-03-05 09:38:51
english is hard, let's go haskelling. :)
monochrom 2017-03-05 09:38:58
@quote monochrom fibonacci.*natur
lambdabot 2017-03-05 09:38:58
monochrom says: the fibonacci sequence is everywhere in nature, for example haskell tutorials and python tutorials
bollu 2017-03-05 09:39:04
lol
bollu 2017-03-05 09:39:09
that is hilarious
monochrom 2017-03-05 09:39:14
:)
hpc 2017-03-05 09:39:29
i miss some of the old quotes
bollu 2017-03-05 09:39:45
hpc: such as?
hpc 2017-03-05 09:39:47
majestic stereo, especially
lolisa 2017-03-05 09:39:50
Hi, so in haskell we can do memo by constructing infinite trie.
c_wraith 2017-03-05 09:39:52
is that one gone?
hpc 2017-03-05 09:39:58
@quote majestic.stereo
lambdabot 2017-03-05 09:39:59
monochrom says: Welcome to #haskell, where @remember's are in majestic stereo!
bollu 2017-03-05 09:40:08
I don't geddit
hpc 2017-03-05 09:40:09
oh, it's still there in some form at least
lolisa 2017-03-05 09:40:16
However can we modifty it so it work on infinite data type?
monochrom 2017-03-05 09:40:39
lolisa: Infinite list and infinite binary search tree also work.
hpc 2017-03-05 09:40:42
bollu: it used to happen really often, but when people would ask questions here, they would get answers from multiple people almost immediately
hpc 2017-03-05 09:40:47
and those answers would be identical
nbro 2017-03-05 09:40:57
imports need to be specified before the definition of main, right?
lolisa 2017-03-05 09:41:06
Like how?
hpc 2017-03-05 09:41:06
so someone said "welcome to #haskell, where questions are answered in majestic stereo"
bollu 2017-03-05 09:41:07
hpc: heh, I see
c_wraith 2017-03-05 09:41:13
nbro: syntactically, yes. imports belong before any definitions
bollu 2017-03-05 09:41:23
hpc: I like the haskell community the best
nbro 2017-03-05 09:41:24
ok, thanks!
bollu 2017-03-05 09:41:26
like, best part of hasell
c_wraith 2017-03-05 09:41:26
nbro: module header, imports, declarations
hpc 2017-03-05 09:41:38
eventually the prevailing answering style turned into two people alternating through the same answer
hpc 2017-03-05 09:41:47
and most of the time coming out looking like one coherent explanation
c_wraith 2017-03-05 09:42:01
sometimes we have 4 people. :)
hpc 2017-03-05 09:42:04
so the quote changed to "welcome to #haskell, where questions are answered in contrapunctual fugue"
bollu 2017-03-05 09:42:21
hpc: ooh, that had happened to me. With you, Cale, and merijn IIRC :P
monochrom 2017-03-05 09:42:22
I invented that one.
Tuplanolla 2017-03-05 09:42:24
Distributed lambdabot could handle that.
bollu 2017-03-05 09:42:30
hpc: you were trying to tell me what "higher kinded" was
bollu 2017-03-05 09:42:35
IIRC
nbro 2017-03-05 09:42:40
how do you manage to have time to be here all the day?! lol
hpc 2017-03-05 09:42:43
heh
bollu 2017-03-05 09:42:45
hpc: any other quotes?
hpc 2017-03-05 09:43:36
dunno