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
# qbhertDomain1 8 | |
[ [1] | |
, [1,2] | |
, [3,1,2] | |
, [3,1,2,4] | |
, [5,3,1,2,4] | |
, [5,3,1,2,4,6] | |
, [7,5,3,1,2,4,6] | |
, [8,7,6,5,4,3,2,1] |
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
performIfSuccedes :: MonadState s m => m (Maybe a) -> m (Maybe a) | |
performIfSuccedes m = do | |
s <- get | |
res <- m | |
case res of | |
Nothing -> put s >> return Nothing | |
Just a -> return (Just a) |
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 Q6 where | |
import Control.Monad | |
import Control.Monad.Random | |
import Data.Numbers.Primes | |
import Data.List | |
import Data.Function | |
thing :: MonadRandom m => Int -> m [Int] | |
thing n = thing' n |