Quantcast
Channel: User Bartek Banachewicz - Code Review Stack Exchange
Browsing latest articles
Browse All 14 View Live

Comment by Bartek Banachewicz on Simple C++ File Indexer

You should certainly get rid of "stdio.h" and "stdlib.h"

View Article



Comment by Bartek Banachewicz on Named operators in C++

Now C++ has <tothepowerof> operator

View Article

Comment by Bartek Banachewicz on Am I thinking functionally in these simple...

\b x in your last example looks like it could be wrapped too.

View Article

Comment by Bartek Banachewicz on Haskell Luhn Algorithm

@jb77 Yep. It applies generally.

View Article

Comment by Bartek Banachewicz on custom win32_file_streambuf

You should find good variable names for each condition statement and use the variables in one if statement, - why didn't you propose such names? Your proposed solution, as it stands, is certainly worse...

View Article


Comment by Bartek Banachewicz on Finding word acronyms for telephone numbers

a1? Ueh. We have b :P

View Article

Comment by Bartek Banachewicz on Idiomatic Leap years in haskell

Probably at least a dozen or so, but you have to ask yourself whether this really matters :)

View Article

Comment by Bartek Banachewicz on Finding the longest path in an...

Your suggestions make sense stylistically, but will they improve performance? My earlier versions were more functional and I rewrote the algorithm to an iterative approach hoping to improve the...

View Article


Expressing computations on values as State

I was writing an application with a few Monads in a transformer stack. The top level application state resides in a TVar, and various components of the application operate on parts of it.I wrote a...

View Article


Answer by Bartek Banachewicz for Am I thinking functionally in these simple...

Overall it's pretty nice. I like that you've learned how to use $; it really improves readability in my opinion. One thing that immediately caught my attention though was the chain of prints. Haskell...

View Article

Polymorphic components for graphics and program state

I asked this question on StackOverflow, got some answers, most notably a link to this one, and basing on that I've implemented this:{-# LANGUAGE RankNTypes #-}{-# LANGUAGE FlexibleContexts #-}module...

View Article

Answer by Bartek Banachewicz for Idiomatic Leap years in haskell

One thing that always comes to my mind when seeing code like that is one of the first principles in programming that everyone learns.Don't repeat yourself.In your code, the part that stands out is mod...

View Article

Finding the longest path in an equally-weighted tree

Its purpose is to find the longest path in an equally-weighted tree denoted as such:31 22 3The first number denotes both the number of vertices and the number of edges (3 - 1).(defn farthest [edg...

View Article


Answer by Bartek Banachewicz for Find labels in string in Haskell

Perhaps something can be done shorterA trick that I often use to avoid creating "filled" objects is simply matching on Just:isIdentical:: Variable -> String -> String -> BoolisIdentical...

View Article
Browsing latest articles
Browse All 14 View Live


Latest Images