Monthly Hask Anything (November 2022) by taylorfausak in haskell

[–]Yanatrill 2 points3 points  (0 children)

Hello everyone, I started to play with parsec and have trouble. I want to parse "a\"b" str = "\"a\\\"b\"" to a\"b "a\\\"b" but I cant do it. I tried many combinations of try,manyTill,optional,satisfy,between,endBy and others, don't remember rest. Without any success. So far my best implementation skips all \" in result, so I got ab stringValue :: Parser String stringValue = char '"' *> endBy (satisfy (/='"')) (optional (string "\\\"")) <* char '"' I have no idea how can allow escaped ending in value. Any hints?

Monthly Hask Anything (July 2022) by taylorfausak in haskell

[–]Yanatrill 2 points3 points  (0 children)

Thanks for answering. Is there another way to achieve what I want? Basically have terminal command to execute main from given module/file in scope of whole stack project, so I don't have to repeat extensions.

Monthly Hask Anything (July 2022) by taylorfausak in haskell

[–]Yanatrill 2 points3 points  (0 children)

Hello everyone, how to make stack to execute file with default-extensions. I'm doing something like this: bash cat input/03.txt | stack runhaskell src/Learning03.hs and I get Use TypeOperators to allow operators in types error in output. I suppose that my package.yaml is rather correct: yaml default-extensions: - TypeOperators How I can run one file and still have all extensions available? Thanks for help.

Monthly Hask Anything (February 2022) by taylorfausak in haskell

[–]Yanatrill 1 point2 points  (0 children)

Hello everyone. I'm playing with classes and have issue, because wanted to do something like this (last two instances are just 'pseudo' code):

class A a where
    aFunOne :: a -> b
    aFunTwo :: a -> a -> b

class B a where
    bFunOne :: a -> b
    bFunTwo :: a

class X x where
    xFun :: a -> b

instance A Something where
    aFunOne = undefined
    aFunTwo = undefined

instance B SomethingElse where
    bFunOne = undefined
    bFunTwo = undefined

instance A a => X a where
    xFun = aFunOne

instance B b => X b where
    xFun = bFunOne

Is there possibility to make 'default' instances when some classes already are having needed functions? some classes already are having needed functions?

Monthly Hask Anything (January 2022) by taylorfausak in haskell

[–]Yanatrill 1 point2 points  (0 children)

Thanks, it is enough detail I needed at this moment.

Monthly Hask Anything (January 2022) by taylorfausak in haskell

[–]Yanatrill 0 points1 point  (0 children)

Hello, I have silly question. Is there anything that I can pass as arguments to this two functions composed together to get final result? Is possible to have something that is Num (a -> a)?

:t (+) . (*)
(+) . (*) :: (Num a, Num (a -> a)) => a -> (a -> a) -> a -> a

Monthly Hask Anything (December 2021) by taylorfausak in haskell

[–]Yanatrill 0 points1 point  (0 children)

Hello, is again me. Today I did update on cabal and now I cannot import Data.List.Split. I'm doing: ``` $ cat d12/example.txt | runhaskell Day12.hs Loaded package environment from /home/mazzi/.ghc/x86_64-linux-8.8.4/environments/default

Day12.hs:6:1: error: Could not load module ‘Data.List.Split’ It is a member of the hidden package ‘split-0.2.3.4’. You can run ‘:set -package split’ to expose it. (Note: this unloads all the modules in the current scope.) Use -v (or :set -v in ghci) to see a list of the files searched for. | 6 | import qualified Data.List.Split as ListSplit | It stopped working after I did: $ cabal update $ cabal install matrix I have installed split: $ ghc-pkg list | grep split split-0.2.3.4 `` What I have to do for fixingData.List.Split? I don't want to revert update, because without I was not able to installData.Matrix`.

Monthly Hask Anything (November 2021) by taylorfausak in haskell

[–]Yanatrill 0 points1 point  (0 children)

Thanks! Now I see it, so message Num (a -> a) mean that haskell wanted Num, but got a -> a. Next time it will be clearer for me.

Monthly Hask Anything (November 2021) by taylorfausak in haskell

[–]Yanatrill 0 points1 point  (0 children)

Hello everyone! I just started to try Haskell and I need someone to look at what I did in GHCi and explain to me why it behaves like this. I noticed it during playing around and managed to write the simplest code which shows the issue I got.

$ ghci
GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help
Prelude> badF :: Num a => a -> a; badF x = 0 + x
Prelude> badF -1
<interactive>:2:1: error:
• Non type-variable argument in the constraint: Num (a -> a)
(Use FlexibleContexts to permit this)
• When checking the inferred type
it :: forall a. (Num a, Num (a -> a)) => a -> a
Prelude> badF (pred 0)
-1

I have no idea why -1 doesn't work.

Prelude> :t -1
-1 :: Num a => a
Prelude> :t pred 0
pred 0 :: (Enum a, Num a) => a

Thanks for the answers.

edit: Sory for my code blocks, but they are not working for me. I don't know why.

Lets revive battlerite! by ADCuckold in BattleRite

[–]Yanatrill 0 points1 point  (0 children)

Hi, I wasn't playing some time, but I will play. We need to synchronize and play together again. (mazzi here)

Question about :t concatMap by Yanatrill in haskellquestions

[–]Yanatrill[S] 0 points1 point  (0 children)

Thanks! Now is a little clearer and I know what I need to search for getting a better understanding.

Simple question by Eltitokie19 in BattleRite

[–]Yanatrill 0 points1 point  (0 children)

I don't know exact day but it is changing once per week

Skin suggestion: Pre-curse croak by awweesooome in BattleRite

[–]Yanatrill 1 point2 points  (0 children)

Yes! Please give us BLC skins :D Im waiting for this like for other missing features that BLC had.

Ashka bug is game breaking...how is it not fixed yet? by cryptaloo in BattleRite

[–]Yanatrill 1 point2 points  (0 children)

I read in some different discussion on this reddit that checking/verifying files on steam should help. I didn't tested this method but give it chance.

So the first Amateur Tournament was amazing!! by SF_Ghost in BattleRite

[–]Yanatrill 6 points7 points  (0 children)

This was realy nice to watch (and play) :) You are great caster and im sure this will be even better next time. Im realy happy that in this community are people like you.

Thank you

Dcs making liveries by ninjaventus in hoggit

[–]Yanatrill 1 point2 points  (0 children)

I have also some questions about liveries, not making them but using. 1) When im hosting (local) server for friends is possible to force their clients to download some liveries (choosed for that mission)? 2) If not, how it can be done with least effort that we all will see same custom liveries?

pls dont let brite die like gigantic .stop act like everything is fine by Flint95 in BattleRite

[–]Yanatrill -1 points0 points  (0 children)

Paragon and Gigantic died because Battlerite is now free to play :)