This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Kuulaskuri (luo, monesko, seuraava) where | |
import Data.IORef | |
newtype Kuulaskuri = Kuulaskuri (IORef Int) | |
luo :: IO Kuulaskuri | |
luo = do | |
c <- newIORef 1 | |
return $ Kuulaskuri c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function init() { | |
naytaLuku("0"); | |
/*eka näytä nolla */ | |
var nappula = document.getElementById("nappi"); | |
var laskin = new Laskin(); | |
/* on nyt tosi rumasti tehty, mutta en keksinyt parempaakaan | |
* eli siis en päässyt tuolta hanskaaHomma-funktiosta | |
* käsiksi laskimeen, yritin vaikka mitä esim. antaa sen olion | |
* tolle hanskaaHommalle parametrina, mutta ei jostain | |
* syystä toiminut. Terkuin 4 tuntia myöhemmin päätin muuttaa |