Hacker Newsnew | past | comments | ask | show | jobs | submit | Arguggi's commentslogin

A substitute for the conky part in my $ conky | dzen status bar. It's practically a learning exercise.

I was inspired by posts like this one [1] to give the free monad a spin and after ~300 lines i'm almost done. But then I found other posts that talk about free and cofree [2] that I still can't really understand so I guess there still is some room for improvement.

[1] http://www.haskellforall.com/2012/06/you-could-have-invented... [2] http://dlaing.org/cofun/posts/free_and_cofree.html


I'd say try and finish before making further improvements.


I just switched from dmenu to the contrib prompt, only thing to look out for is that the searchPredicate function of the XPConfig doesn't actually seem to do anything.

Setting:

  searchPredicate :: String -> String -> Bool
  searchPredicate = \_ _ -> False
seems to make no difference.

And the default is:

  searchPredicate = isPrefixOf

Patching and recompiling with this patch[1] mentioned here[2] seems to fix the issue.

[1]: https://code.google.com/p/xmonad/issues/attachmentText?id=39... [2]: https://code.google.com/p/xmonad/issues/detail?id=393


Care to resubmit that patch at https://github.com/xmonad/xmonad-contrib? That way it can be part of the 0.12 release.


This seems pretty similar to the Haskell Maybe Monad.

"Learn You a Haskell for Great Good!" has an example[0]:

  routine =   
    case Just (0,0) of   
        Nothing -> Nothing  
        Just start -> case landLeft 2 start of  
            Nothing -> Nothing  
            Just first -> case landRight 2 first of  
                Nothing -> Nothing  
                Just second -> landLeft 1 second
becomes (using some 'do' syntactic sugar):

  routine = do  
    start <- return (0,0)  
    first <- landLeft 2  
    second <- landRight 2 first  
    landLeft 1 second
Checking for Nothing is taken care of 'automatically' and if any of start, first, second or (landLeft 1 second) are equal to Nothing routine is equal to Nothing too.

[0] http://learnyouahaskell.com/a-fistful-of-monads#walk-the-lin...


This isn't really the same thing. Haskell (and Ocaml) make you deal with the null case, whereas C# just lets you propagate the nulls. Haskell's way is safer, c# is just handy syntax.


Which goes to show that what requires a 'new feature' in C# is just a freebie in Haskell, due to the powerful type system. See my other comment ITT for how to do this in a tighter way that is more like the C# syntax. (You just use the bind operator rather than wrapping it in a do)


It's basically the same thing, except with that syntax, you have to label all the intermediate results


To avoid labeling:

    routine :: Int -> Maybe Int  
    routine n = Just n >>= (divisorFilter 3) >>= (divisorFilter 2) >>= (divisorFilter 5)

    -- Supporting function
    divisorFilter :: Int -> Int -> Maybe Int
    divisorFilter d n
        | n `mod` d == 0 = Just n
        | otherwise = Nothing
        
    -- Using do syntax
    routine' :: Int -> Maybe Int  
    routine' n = do  
        first <- divisorFilter 3 n
        second <- divisorFilter 2 first
        divisorFilter 5 second


You can stop certain packages from being updated [0] but the wiki explicity says it's "unsupported" [1] so probably best to update everything and hope nothing breaks.

New packages for the "core" repo, for example the Linux kernel, are first introduced to the "testing" repo, which isn't enabled by default. You would have to manually change your pacman.conf to use it.

From the wiki [2]:

"After a kernel in core broke many user systems, the "core signoff policy" was introduced. Since then, all package updates for core need to go through a testing repository first, and only after multiple signoffs from other developers are they allowed to move. Over time, it was noticed that various core packages had low usage, and user signoffs or even lack of bug reports became informally accepted as criteria to accept such packages."

[0]: https://wiki.archlinux.org/index.php/Pacman#Skip_package_fro... [1]: https://wiki.archlinux.org/index.php/Pacman#Partial_upgrades... [2]: https://wiki.archlinux.org/index.php/Official_repositories#H...


It's usually no problem to keep a package or two from upgrading via the --ignore argument to pacman. Arch calling it "unsupported" doesn't mean it's inherently risky, it mainly comes from the fact that you can shoot yourself in the foot with it if you do it to something like glibc. Keeping a userland program like Chrome or Gimp downgraded will not screw up your system.


pacman (Arch's package manager) does not build from source, it downloads binary packages from the repos just like Ubuntu. Differently from Ubuntu packages are usually as vanilla and up to date as possible.

You build packages from source when you install something from the AUR[0] or you can build from the Arch Build System [1].

[0] https://wiki.archlinux.org/index.php/Arch_User_Repository

[1] https://wiki.archlinux.org/index.php/Arch_Build_System


Every binary package was built using ABS though, and a PKGBUILD is just a bash script so you do have the flexibility to build every package from source a la Gentoo.


You are correct, I forgot about pacman - and yeah I was referring to AUR in my previous comment.


Shameless plug: I've been trying a list with every issue I encounter while using arch [0], as of today I've had ~10 issues in ~170 days. Each issue has taken me ~5 minutes to solve.

[0] https://arguggi.co.uk/blog/list.html


TFA and your blog post both mention SLiM as a login manager, according to the Arch wiki[0]:

"The SliM project has been abandoned (the project homepage is down, leaving a github mirror), and is not fully compatible to systemd, including logind sessions. Consider using a different Display manager or Xinitrc."

Lightdm [1] seems to be a better alternative.

[0] https://wiki.archlinux.org/index.php/SLiM [1] https://wiki.archlinux.org/index.php/LightDM


Yes officially it is, but notice the date the post was made. It was before the SLiM abandoned :-) I use my self and would recommend LightDM instead of SLiM now. But thank you for pointing this out. I'll post new arch install article one of this days ^_^

I would also like to say that I've been using Arch Linux since 2011 and it works for my development needs. I'm using it with 3-monitors on two separate "GeForce GT 610" video cards. I've tried many other distros including Ubuntu and Fedora both GNOME/KDE. I prefer Arch + XFCE + LightDM my self :-)


Slim is still working for me on systemd here. Didn't even know it was abandoned...

I guess I'll give LightDM a look, just in case. Thanks for the heads up!


Slim still works if you don't go the systemd route though. Guix use it for instance.


I've been trying to keep a problem log for arch updates for the past few months [0] but I haven't tried not updating for a while.

Now I'm curious, so I guess I'm trying it for a month [1].

[0] https://arguggi.co.uk/blog/list.html [1] https://arguggi.co.uk/blog/Not-Updating/


The usual "Arch is unstable" convinced me to put up a very simple jekyll blog [0] with all the arch related problems I run into from here on out.

I've only listed the last 2 problems now. As months go by the list will probably get longer and better reflect how much arch actually breaks (or doesn't)

[0] https://arguggi.co.uk/blog/I-Just-Want-It-To-Work/


nice, i had one the other day where convert would take 5 seconds to resize a jpeg. i downgraded it and it was fine. i probably should have filed a bug, but i had work to do, and had already wasted enough time waiting for images to resize!


Am I the only one troubled by the last example?

And then suppose you encounter a woman who tells you that because of the insults she has received from guys in the skeptic community, she has decided that the skeptic movement is fundamentally sexist.

Receiving insults from men that identify as skeptics does not mean that the skeptic movement is fundamentally sexist.

Telling her she just committed a fallacy doesn't seem so wrong to me.


She may have just committed a fallacy in truth.

That doesn't mean telling her so is the right choice.

If you don't address her experience, you're missing the point.

You can "believe" all kinds of things without feeling them and living them out.

In her case, skeptics may believe they are not fundamentally sexist. But her observation would then be that this belief is only skin deep. It should trouble the skeptic that an observer finds their community sexist, and trigger a crisis in the belief.


In that example, the author makes his own fallacy. Apparently the speaker's experiences are the only valid ones, and the responder has no right to share his experience - which some of his "I hope it should be clear that none of these are appropriate responses" are doing.

Some of his examples are condescending, which is the basis of what he's trying to get at, others are only condescending if you wilfully choose to take them that way. The problem isn't in pointing out the fallacy, it's with the tone of the commentary. The simple fact that you name a fallacy while exposing it does not mean you're a lazy debater.


I agree that only answering "You just committed a fallacy, goodbye" would not be the right choice, but at least mentioning it and then try to explain why I think it's relevant doesn't seem so wrong.


Did ya miss the whole thing about figurative language?


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: