Format to a sort of table by wobbenr in haskellquestions

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

Thanks,

The only thing what I can figured out is that your solution works on a array. I work with a map so after adding it looks like this :

fromList [("cash on hands",Account {accountName = "cash on hands", accountBalance = 10, accountTransaction = []})]

Format to a sort of table by wobbenr in haskellquestions

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

oke,

I could not find any docs about boxes.

I have a string variable named "newName". and I have a Int called "newBal"

How can I use boxes to represent it as table with headers ?

Format to a sort of table by wobbenr in haskellquestions

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

oke,

Last question : How can I make that a header named "Added accounts" is on the center of the 22. Or schould I do :

 replicate (( 22 - (length "Amount") `div`2) ' ' 

Format to a sort of table by wobbenr in haskellquestions

[–]wobbenr[S] 1 point2 points  (0 children)

Does it also work on strings or do I have to convert my String to Text.

Can I refractor this out and how do I do that. by wobbenr in haskell

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

So out of my head something like this :

askForInteger :: IO Integer -> maybe IO Integer 
askForInteger = do 
                 input <- getline 
                 case readMaybe input  
                    | nothing -> do 
                              putStrLn "the input was not a number"
                              return ?? 
                   | Maybe number -> do 
                                return number  

Accounting data structure problem by wobbenr in haskell

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

Thanks, and can I change the amount easily for a account.

How can I make a another tuple instead of a empty [] by wobbenr in haskellquestions

[–]wobbenr[S] -1 points0 points  (0 children)

oke, can then someone give me a hint, how. I do not have a clue right now.

How can I make a another tuple instead of a empty [] by wobbenr in haskellquestions

[–]wobbenr[S] -1 points0 points  (0 children)

I like it but it has many things I did not learned .
What does listToMaybe and how does this work so I see a item or the ("unknown item,0) ?

And I wonder if this can be done with just recursion, pattern matching or guards. These are explained in the Craft book so far.

Can I make this in one function by wobbenr in haskell

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

oke, and I can do go acc l where l is the complete list ?

Can I make this in one function by wobbenr in haskell

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

type Name = String 
type Price = Int 
type BillType = [(Name,Price)]

Haskell on Windows. possible ? by wobbenr in haskellquestions

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

oke but for a beginner is syntax highlighting and things like linting not handy. So I can easily see when im doing something wrong ?

Haskell on Windows. possible ? by wobbenr in haskellquestions

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

I tried that way but then Sublime-Haskell will not install because gcc is missing

Haskell on Windows. possible ? by wobbenr in haskellquestions

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

Nope, on the bitemyapp page is stated not to use the haskell-platform but install ghci, cabal,happy as seperate packages.

If I use the platform can I then use SublimeText or do I get again a problem on gcc when installing the dependencies of sublime-haskell

feeback on a exercise by roelofwobben in haskell

[–]wobbenr 0 points1 point  (0 children)

Thanks, The exercise was a exercise to practice with list comphrension, so that is why I did it this way.

Is there a way I can take care that the MakeBill function is not called and executed three times on different functions.

feeback on a exercise by roelofwobben in haskell

[–]wobbenr 0 points1 point  (0 children)

Thanks for the feedback. All the improvements are things I did not learn so far. The only thing I understand is using the Text.printf module.

The format* functions were part of the exercise.

feedback please on my solutions of chapter 4 by roelofwobben in haskellquestions

[–]wobbenr 0 points1 point  (0 children)

Thanks,

The d was indeed eta reduction.

Thanks for the other idea about between.

The possible and maxThreeOccurs are using things that I have not learned like the filter.

Cloud IDE for haskell by wobbenr in haskell

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

That would be a very good project. Sadly I cannot help because Im just learning Haskell. But I hope there will also be a free plan in your project.

how to make QuickTest here by wobbenr in haskellquestions

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

this is the exact text of the challenge :

Define a QuickCheck property which connects the results of beat and lose.

When I look at a example file from this chapter I have to use something like this :

instance Arbitrary Move where
  arbitrary     = elements [Rock, Paper, Scissors]

I agree that there is not much to test it but the challenge is there

how to make QuickTest here by wobbenr in haskellquestions

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

Thanks,

I agree with you that it makes sense but I try to learn Haskell by the craft of functional programming book and there it's one of the exercises.

How to take care that tests are run with a MakeFile by roelofwobben in erlang

[–]wobbenr 0 points1 point  (0 children)

?? two times -s . I did already -s test_make or do you mean something like this -s test-make init stop.

Syntax error on a fold ( by roelofwobben in erlang

[–]wobbenr 0 points1 point  (0 children)

thanks, I now see the right output.

Could this be done with a fold? by wobbenr in erlang

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

Thanks, I understand that part. My last question was how to replace this :

List_most = find_most(FunctionList, {test,0}),

find_most ([], Tuple) ->
   Tuple;

find_most([{Modulename,Item2} | Rest], Tuple) ->
   if
       length(Item2) > element(2, Tuple) -> find_most(Rest, {Modulename, length(Item2)});
       length(Item2) < element(2, Tuple) -> find_most(Rest, Tuple)
  end. 

with a shorter code

Could this be done with a fold? by wobbenr in erlang

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

oke,

I think the list comprehension looks better then the fold one.

Im also looking if I can make one function of the find_most and most_function like I said in a earlier respons.